Search in sources :

Example 6 with TimestampsFilter

use of org.apache.hadoop.hbase.filter.TimestampsFilter in project hbase by apache.

the class TestTimestampFilterSeekHint method testGetSeek.

@Test
public void testGetSeek() throws IOException {
    StoreFileScanner.instrument();
    prepareRegion();
    Get g = new Get(RK_BYTES);
    final TimestampsFilter timestampsFilter = new TimestampsFilter(ImmutableList.of(5L), true);
    g.setFilter(timestampsFilter);
    final long initialSeekCount = StoreFileScanner.getSeekCount();
    region.get(g);
    final long finalSeekCount = StoreFileScanner.getSeekCount();
    /*
      Make sure there's more than one.
      Aka one seek to get to the row, and one to get to the time.
    */
    assertTrue(finalSeekCount >= initialSeekCount + 3);
}
Also used : Get(org.apache.hadoop.hbase.client.Get) TimestampsFilter(org.apache.hadoop.hbase.filter.TimestampsFilter) Test(org.junit.Test)

Aggregations

TimestampsFilter (org.apache.hadoop.hbase.filter.TimestampsFilter)6 Test (org.junit.Test)4 Get (org.apache.hadoop.hbase.client.Get)3 ArrayList (java.util.ArrayList)2 Filter (org.apache.hadoop.hbase.filter.Filter)2 HTableDescriptor (org.apache.hadoop.hbase.HTableDescriptor)1 Put (org.apache.hadoop.hbase.client.Put)1 Result (org.apache.hadoop.hbase.client.Result)1