public void testTombstone() throws Exception {
FlushCounter handler = new FlushCounter();
SortedOplogFactory factory = new HFileSortedOplogFactory("tombstone", null, new SortedOplogStatistics("stats", "tombstone"), new HFileStoreStatistics("storeStats", "tombstone"));
Compactor compactor = new SizeTieredCompactor(factory,
NonCompactor.createFileset("tombstone", new File(".")),
new FileTracker(),
Executors.newSingleThreadExecutor(),
2, 2);
SortedOplogSet sos = new SortedOplogSetImpl(factory, Executors.newSingleThreadExecutor(), compactor);
for (int i = 0; i < 1000; i++) {
sos.put(wrapInt(i), wrapInt(i));
}
sos.flush(null, handler);
for (int i = 900; i < 1000; i++) {
sos.put(wrapInt(i), new byte[] {SoplogToken.TOMBSTONE.toByte()});
}
flushAndWait(handler, sos);
compactAndWait(sos, true);
validate(sos, 900);
sos.close();
}