@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)); }
@Override public ReturnCode filterKeyValue(KeyValue ignored) { return ignored.getTimestamp() > timestamp ? ReturnCode.SKIP : ReturnCode.INCLUDE; }
NewerTimestampFilter extends FilterBase { @Override public ReturnCode filterKeyValue(KeyValue ignored) { return ignored.getTimestamp() > timestamp ? ReturnCode.SKIP : ReturnCode.INCLUDE; } }
NewerTimestampFilter extends FilterBase { @Override public ReturnCode filterKeyValue(KeyValue ignored) { return ignored.getTimestamp() > timestamp ? ReturnCode.SKIP : ReturnCode.INCLUDE; } NewerTimestampFilter(long timestamp); }
NewerTimestampFilter extends FilterBase { @Override public ReturnCode filterKeyValue(KeyValue ignored) { return ignored.getTimestamp() > timestamp ? ReturnCode.SKIP : ReturnCode.INCLUDE; } NewerTimestampFilter(long timestamp); @Override ReturnCode filterKeyValue(KeyValue ignored); @Override void write(DataOutput out); @Override void readFields(DataInput in); }
NewerTimestampFilter extends FilterBase { @Override public ReturnCode filterKeyValue(KeyValue ignored) { return ignored.getTimestamp() > timestamp ? ReturnCode.SKIP : ReturnCode.INCLUDE; } NewerTimestampFilter(long timestamp); @Override ReturnCode filterKeyValue(KeyValue ignored); @Override void write(DataOutput out); @Override void readFields(DataInput in);  }