Class TestTimestampsFilter

java.lang.Object
org.apache.hadoop.hbase.client.TestTimestampsFilter

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

    Fields
    Modifier and Type
    Field
    Description
    static final HBaseClassTestRule
     
    org.junit.rules.TestName
     
    private static final HBaseTestingUtil
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    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
     
    static void
     
    void
     
    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)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • setUpBeforeClass

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

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

      public void setUp() throws Exception
      Throws:
      Exception
    • tearDown

      public void tearDown() throws Exception
      Throws:
      Exception
    • testTimestampsFilter

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

      public void testMultiColumns() throws Exception
      Throws:
      Exception
    • testWithVersionDeletes

      public void testWithVersionDeletes() throws Exception
      Test TimestampsFilter in the presence of version deletes.
      Throws:
      Exception
    • testWithVersionDeletes

      private void testWithVersionDeletes(boolean flushTables) throws IOException
      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