Package org.apache.hadoop.hbase.client
Class TestMultipleTimestamps
java.lang.Object
org.apache.hadoop.hbase.client.TestMultipleTimestamps
Run tests related to
TimestampsFilter
using HBase client
APIs. Sets up the HBase mini cluster once at start. Each creates a table named for the method and
does its stuff against that.-
Field Summary
Modifier and TypeFieldDescriptionstatic final HBaseClassTestRule
private static final org.slf4j.Logger
org.junit.rules.TestName
private static final HBaseTestingUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
checkOneCell
(org.apache.hadoop.hbase.Cell kv, byte[] cf, int rowIdx, int colIdx, long ts) Assert that the passed in KeyValue has expected contents for the specified row, column & timestamp.private void
deleteAllVersionsBefore
(org.apache.hadoop.hbase.client.Table ht, byte[] cf, int rowIdx, int colIdx, long version) For row/column specified by rowIdx/colIdx, delete all cells preceeding the specified version.private void
deleteColumn
(org.apache.hadoop.hbase.client.Table ht, byte[] cf, int rowIdx, int colIdx) private void
deleteFamily
(org.apache.hadoop.hbase.client.Table ht, byte[] cf, int rowIdx) private void
deleteOneVersion
(org.apache.hadoop.hbase.client.Table ht, byte[] cf, int rowIdx, int colIdx, long version) For row/column specified by rowIdx/colIdx, delete the cell corresponding to the specified version.private org.apache.hadoop.hbase.Cell[]
getNVersions
(org.apache.hadoop.hbase.client.Table ht, byte[] cf, int rowIdx, int colIdx, List<Long> versions) Uses the TimestampFilter on a Get to request a specified list of versions for the row/column specified by rowIdx & colIdx.private void
put
(org.apache.hadoop.hbase.client.Table ht, byte[] cf, Integer[] rowIndexes, Integer[] columnIndexes, Long[] versions) private void
putNVersions
(org.apache.hadoop.hbase.client.Table ht, byte[] cf, int rowIdx, int colIdx, long versionStart, long versionEnd) Insert in specific row/column versions with timestamps versionStart..versionEnd.private org.apache.hadoop.hbase.client.ResultScanner
scan
(org.apache.hadoop.hbase.client.Table ht, byte[] cf, Integer[] rowIndexes, Integer[] columnIndexes, Long[] versions, int maxVersions) void
setUp()
static void
void
tearDown()
static void
void
void
void
void
void
void
void
void
void
testWithVersionDeletes
(boolean flushTables)
-
Field Details
-
CLASS_RULE
-
LOG
-
TEST_UTIL
-
name
-
-
Constructor Details
-
TestMultipleTimestamps
public TestMultipleTimestamps()
-
-
Method Details
-
setUpBeforeClass
- Throws:
Exception
-
tearDownAfterClass
- Throws:
Exception
-
setUp
- Throws:
Exception
-
tearDown
- Throws:
Exception
-
testReseeksWithOneColumnMiltipleTimestamp
- Throws:
IOException
-
testReseeksWithMultipleColumnOneTimestamp
- Throws:
IOException
-
testReseeksWithMultipleColumnMultipleTimestamp
- Throws:
IOException
-
testReseeksWithMultipleFiles
- Throws:
IOException
-
testWithVersionDeletes
- Throws:
Exception
-
testWithVersionDeletes
- Throws:
IOException
-
testWithMultipleVersionDeletes
- Throws:
IOException
-
testWithColumnDeletes
- Throws:
IOException
-
testWithFamilyDeletes
- Throws:
IOException
-
checkOneCell
private void checkOneCell(org.apache.hadoop.hbase.Cell kv, byte[] cf, int rowIdx, int colIdx, long ts) Assert that the passed in KeyValue has expected contents for the specified row, column & timestamp. -
getNVersions
private org.apache.hadoop.hbase.Cell[] getNVersions(org.apache.hadoop.hbase.client.Table ht, byte[] cf, int rowIdx, int colIdx, List<Long> versions) throws IOException Uses the TimestampFilter on a Get to request a specified list of versions for the row/column specified by rowIdx & colIdx.- Throws:
IOException
-
scan
private org.apache.hadoop.hbase.client.ResultScanner scan(org.apache.hadoop.hbase.client.Table ht, byte[] cf, Integer[] rowIndexes, Integer[] columnIndexes, Long[] versions, int maxVersions) throws IOException - Throws:
IOException
-
put
private void put(org.apache.hadoop.hbase.client.Table ht, byte[] cf, Integer[] rowIndexes, Integer[] columnIndexes, Long[] versions) throws IOException - Throws:
IOException
-
putNVersions
private void putNVersions(org.apache.hadoop.hbase.client.Table ht, byte[] cf, int rowIdx, int colIdx, long versionStart, long versionEnd) throws IOException Insert in specific row/column versions with timestamps versionStart..versionEnd.- Throws:
IOException
-
deleteOneVersion
private void deleteOneVersion(org.apache.hadoop.hbase.client.Table ht, byte[] cf, int rowIdx, int colIdx, long version) throws IOException For row/column specified by rowIdx/colIdx, delete the cell corresponding to the specified version.- Throws:
IOException
-
deleteAllVersionsBefore
private void deleteAllVersionsBefore(org.apache.hadoop.hbase.client.Table ht, byte[] cf, int rowIdx, int colIdx, long version) throws IOException For row/column specified by rowIdx/colIdx, delete all cells preceeding the specified version.- Throws:
IOException
-
deleteColumn
private void deleteColumn(org.apache.hadoop.hbase.client.Table ht, byte[] cf, int rowIdx, int colIdx) throws IOException - Throws:
IOException
-
deleteFamily
private void deleteFamily(org.apache.hadoop.hbase.client.Table ht, byte[] cf, int rowIdx) throws IOException - Throws:
IOException
-