Package org.apache.hadoop.hbase.client
Class TestTimestampsFilter
java.lang.Object
org.apache.hadoop.hbase.client.TestTimestampsFilter
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
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
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
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.Result[]
scanNVersions
(org.apache.hadoop.hbase.client.Table ht, byte[] cf, int startRowIdx, int endRowIdx, List<Long> versions) Uses the TimestampFilter on a Scan to request a specified list of versions for the rows from startRowIdx to endRowIdx (both inclusive).void
setUp()
static void
void
tearDown()
static void
void
void
Test from client side for TimestampsFilter.void
Test TimestampsFilter in the presence of version deletes.private void
testWithVersionDeletes
(boolean flushTables) private void
verifyInsertedValues
(org.apache.hadoop.hbase.client.Table ht, byte[] cf)
-
Field Details
-
CLASS_RULE
-
TEST_UTIL
-
name
-
-
Constructor Details
-
TestTimestampsFilter
public TestTimestampsFilter()
-
-
Method Details
-
setUpBeforeClass
- Throws:
Exception
-
tearDownAfterClass
- Throws:
Exception
-
setUp
- Throws:
Exception
-
tearDown
- Throws:
Exception
-
testTimestampsFilter
Test from client side for TimestampsFilter. The TimestampsFilter provides the ability to request cells (KeyValues) whose timestamp/version is in the specified list of timestamps/version.- Throws:
Exception
-
testMultiColumns
- Throws:
Exception
-
testWithVersionDeletes
Test TimestampsFilter in the presence of version deletes.- Throws:
Exception
-
testWithVersionDeletes
- Throws:
IOException
-
verifyInsertedValues
private void verifyInsertedValues(org.apache.hadoop.hbase.client.Table ht, byte[] cf) throws IOException - 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
-
scanNVersions
private org.apache.hadoop.hbase.client.Result[] scanNVersions(org.apache.hadoop.hbase.client.Table ht, byte[] cf, int startRowIdx, int endRowIdx, List<Long> versions) throws IOException Uses the TimestampFilter on a Scan to request a specified list of versions for the rows from startRowIdx to endRowIdx (both inclusive).- 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
-