Package org.apache.hadoop.hbase.client
Class TestTimestampsFilter
java.lang.Object
org.apache.hadoop.hbase.client.TestTimestampsFilter
@Tag("org.apache.hadoop.hbase.testclassification.MediumTests") @Tag("org.apache.hadoop.hbase.testclassification.ClientTests")
public class TestTimestampsFilter
extends Object
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
FieldsModifier and TypeFieldDescriptionprivate static final org.slf4j.Loggerprivate Stringprivate static final HBaseTestingUtil -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcheckOneCell(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 voiddeleteOneVersion(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 voidputNVersions(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).voidsetUp()static voidvoidsetUpMethodName(org.junit.jupiter.api.TestInfo testInfo) voidtearDown()static voidvoidvoidTest from client side for TimestampsFilter.voidTest TimestampsFilter in the presence of version deletes.private voidtestWithVersionDeletes(boolean flushTables) private voidverifyInsertedValues(org.apache.hadoop.hbase.client.Table ht, byte[] cf)
-
Field Details
-
LOG
-
TEST_UTIL
-
methodName
-
-
Constructor Details
-
TestTimestampsFilter
public TestTimestampsFilter()
-
-
Method Details
-
setUpMethodName
-
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
-