LinkIndexUpdaterEditFilter implements WALEditFilter { @Override public void apply(WALEdit walEdit) { List<KeyValue> keyValues = walEdit.getKeyValues(); for (int i = keyValues.size() - 1; i >= 0; i--) { KeyValue kv = keyValues.get(i); if (!(kv.matchingColumn(RecordCf.DATA.bytes, RecordColumn.PAYLOAD.bytes))) { keyValues.remove(i); } } }  @Override void apply(WALEdit walEdit);  }
@Test public void testApply_NoPayload() { WALEdit walEdit = new WALEdit(); walEdit.add(new KeyValue(Bytes.toBytes("row"), RecordCf.DATA.bytes, RecordColumn.OCC.bytes, Bytes.toBytes(123))); editFilter.apply(walEdit); assertEquals(0, walEdit.getKeyValues().size()); }
@Test public void testApply_WithPayload() { WALEdit walEdit = new WALEdit(); walEdit.add(new KeyValue(Bytes.toBytes("row"), RecordCf.DATA.bytes, RecordColumn.PAYLOAD.bytes, Bytes.toBytes("payload"))); editFilter.apply(walEdit); assertEquals(1, walEdit.getKeyValues().size()); }