Examples of NewerTimestampFilter


Examples of org.apache.phoenix.hbase.index.covered.filter.NewerTimestampFilter

  byte[] val = Bytes.toBytes("val");

  @Test
  public void testOnlyAllowsOlderTimestamps() {
    long ts = 100;
    NewerTimestampFilter filter = new NewerTimestampFilter(ts);

    KeyValue kv = new KeyValue(row, fam, qual, ts, val);
    assertEquals("Didn't accept kv with matching ts", ReturnCode.INCLUDE, filter.filterKeyValue(kv));

    kv = new KeyValue(row, fam, qual, ts + 1, val);
    assertEquals("Didn't skip kv with greater ts", ReturnCode.SKIP, filter.filterKeyValue(kv));

    kv = new KeyValue(row, fam, qual, ts - 1, val);
    assertEquals("Didn't accept kv with lower ts", ReturnCode.INCLUDE, filter.filterKeyValue(kv));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.