@Override public SortedIterator<ByteBuffer> scan( byte[] from, boolean fromInclusive, byte[] to, boolean toInclusive, boolean ascending, MetadataFilter filter) throws IOException { return sos.scan(from, fromInclusive, to, toInclusive, ascending, filter); }
public void testScanAfterClose() throws IOException { SortedIterator<ByteBuffer> iter = set.scan(); set.close(); assertFalse(iter.hasNext()); }
public void testScanAfterClear() throws IOException { SortedIterator<ByteBuffer> iter = set.scan(); set.clear(); assertFalse(iter.hasNext()); }
public void testDestroy() throws IOException { set.destroy(); assertTrue(((SortedOplogSetImpl) set).isClosed()); try { set.scan(); fail(); } catch (IllegalStateException e) { } }
protected void validateEmpty(SortedOplogSet sos) throws IOException { assertEquals(0, sos.bufferSize()); assertEquals(0, sos.unflushedSize()); SortedIterator<ByteBuffer> iter = sos.scan(); assertFalse(iter.hasNext()); iter.close(); sos.close(); }
SortedIterator<ByteBuffer> iter = sos.scan(); try { while (iter.hasNext()) {
public void testInUse() throws Exception { FlushCounter handler = new FlushCounter(); SortedOplogSet sos = createSoplogSet("inuse"); for (int i = 0; i < 1000; i++) { sos.put(wrapInt(i), wrapInt(i)); } flushAndWait(handler, sos); // start iterating over soplog SortedIterator<ByteBuffer> range = sos.scan(); assertEquals(0, ((SizeTieredCompactor) sos.getCompactor()).countInactiveReaders()); for (int i = 1000; i < 5000; i++) { sos.put(wrapInt(i), wrapInt(i)); if (i % 100 == 0) { sos.flush(null, handler); } } flushAndWait(handler, sos); compactAndWait(sos, false); assertEquals(1, ((SizeTieredCompactor) sos.getCompactor()).countInactiveReaders()); range.close(); compactAndWait(sos, false); assertEquals(0, ((SizeTieredCompactor) sos.getCompactor()).countInactiveReaders()); validate(sos, 5000); sos.close(); }