Class TestFiltersWithBinaryComponentComparator

java.lang.Object
org.apache.hadoop.hbase.filter.TestFiltersWithBinaryComponentComparator

  • Field Details

    • CLASS_RULE

      public static final HBaseClassTestRule 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

      private static final HBaseTestingUtil TEST_UTIL
    • LOG

      private static final org.slf4j.Logger LOG
    • family

      private byte[] family
    • qf

      private byte[] qf
    • tableName

      private org.apache.hadoop.hbase.TableName tableName
    • aOffset

      private int aOffset
    • bOffset

      private int bOffset
    • cOffset

      private int cOffset
    • dOffset

      private int dOffset
    • name

      public org.junit.rules.TestName name
  • Constructor Details

  • Method Details

    • setUpBeforeClass

      public static void setUpBeforeClass() throws Exception
      Throws:
      Exception
    • tearDownAfterClass

      public static void tearDownAfterClass() throws Exception
      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

      private void setRowFilters(org.apache.hadoop.hbase.filter.FilterList filterList)
    • setValueFilters

      private void setValueFilters(org.apache.hadoop.hbase.filter.FilterList filterList)
      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