Package org.apache.hadoop.hbase.filter
Class TestFiltersWithBinaryComponentComparator
java.lang.Object
org.apache.hadoop.hbase.filter.TestFiltersWithBinaryComponentComparator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private int
static final HBaseClassTestRule
See https://issues.apache.org/jira/browse/HBASE-22969 - for need of BinaryComponentComparator The descrption on jira should also help you in understanding tests implemented in this classprivate int
private int
private byte[]
private static final org.slf4j.Logger
org.junit.rules.TestName
private byte[]
private org.apache.hadoop.hbase.TableName
private static final HBaseTestingUtility
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate org.apache.hadoop.hbase.client.Scan
createScan
(org.apache.hadoop.hbase.filter.FilterList list) private void
generateRows
(org.apache.hadoop.hbase.client.Table ht, byte[] family, byte[] qf) Since we are trying to emulate SQL: SELECT * from table where a = 1 and b > 10 and b < 20 and c > 90 and c < 100 and d = 1 We are generating rows with: a = 1, b >=9 and b < 22, c >= 89 and c < 102, and d = 1 At the end the table will look something like this: ------------ a| b| c|d| ------------ 1| 9| 89|1|family:qf|xyz| ----------- 1| 9| 90|1|family:qf|abc| ----------- 1| 9| 91|1|family:qf|xyz| ------------------------- .private List<org.apache.hadoop.hbase.Cell>
getResults
(org.apache.hadoop.hbase.client.Table ht, org.apache.hadoop.hbase.client.Scan scan) private void
setRowFilters
(org.apache.hadoop.hbase.filter.FilterList filterList) static void
private void
setValueFilters
(org.apache.hadoop.hbase.filter.FilterList filterList) We have rows with either "abc" or "xyz".static void
void
void
void
-
Field Details
-
CLASS_RULE
See https://issues.apache.org/jira/browse/HBASE-22969 - for need of BinaryComponentComparator The descrption on jira should also help you in understanding tests implemented in this class -
TEST_UTIL
-
LOG
-
family
-
qf
-
tableName
-
aOffset
-
bOffset
-
cOffset
-
dOffset
-
name
-
-
Constructor Details
-
TestFiltersWithBinaryComponentComparator
-
-
Method Details
-
setUpBeforeClass
- Throws:
Exception
-
tearDownAfterClass
- Throws:
Exception
-
testRowFilterWithBinaryComponentComparator
- Throws:
IOException
-
testValueFilterWithBinaryComponentComparator
- Throws:
IOException
-
testRowAndValueFilterWithBinaryComponentComparator
- Throws:
IOException
-
generateRows
private void generateRows(org.apache.hadoop.hbase.client.Table ht, byte[] family, byte[] qf) throws IOException Since we are trying to emulate SQL: SELECT * from table where a = 1 and b > 10 and b < 20 and c > 90 and c < 100 and d = 1 We are generating rows with: a = 1, b >=9 and b < 22, c >= 89 and c < 102, and d = 1 At the end the table will look something like this: ------------ a| b| c|d| ------------ 1| 9| 89|1|family:qf|xyz| ----------- 1| 9| 90|1|family:qf|abc| ----------- 1| 9| 91|1|family:qf|xyz| ------------------------- . ------------------------- . ------------------------- 1|21|101|1|family:qf|xyz|- Throws:
IOException
-
setRowFilters
-
setValueFilters
We have rows with either "abc" or "xyz". We want values which have 'y' at second position of the string. As a result only values with "xyz" shall be returned -
createScan
private org.apache.hadoop.hbase.client.Scan createScan(org.apache.hadoop.hbase.filter.FilterList list) -
getResults
private List<org.apache.hadoop.hbase.Cell> getResults(org.apache.hadoop.hbase.client.Table ht, org.apache.hadoop.hbase.client.Scan scan) throws IOException - Throws:
IOException
-