@Test public void testDisableSave() throws Exception { BatchIterator bi = new BatchIterator(new FakeRelationalNode(1, new List[] { Arrays.asList(1), Arrays.asList(1), Arrays.asList(1), Arrays.asList(1), Arrays.asList(1), Arrays.asList(1), }, 2)); BufferManager bm = BufferManagerFactory.getStandaloneBufferManager(); TupleBuffer tb = bm.createTupleBuffer(Arrays.asList(new ElementSymbol("x", null, DataTypeManager.DefaultDataClasses.INTEGER)), "test", TupleSourceType.PROCESSOR); bi.setBuffer(tb, false); bi.setPosition(2); assertTrue(bi.hasNext()); tb.setForwardOnly(true); bi.setPosition(1); bi.disableSave(); for (int i = 0; i < 6; i++) { assertNotNull(bi.nextTuple()); } assertNull(bi.nextTuple()); assertEquals(0, tb.getManagedRowCount()); }
public void disableSave() { if (buffer != null) { this.saveOnMark = true; this.mark = false; if (batch != null && batch.getEndRow() <= this.buffer.getRowCount()) { this.batch = null; } } }
BatchIterator extends AbstractTupleSource { public void disableSave() { if (buffer != null) { this.saveOnMark = true; this.mark = false; if (batch != null && batch.getEndRow() <= this.buffer.getRowCount()) { this.batch = null; } } } }
BatchIterator extends AbstractTupleSource { public void disableSave() { if (buffer != null) { this.saveOnMark = true; this.mark = false; if (batch != null && batch.getEndRow() <= this.buffer.getRowCount()) { this.batch = null; } } } BatchIterator(BatchProducer source); }
BatchIterator extends AbstractTupleSource { public void disableSave() { if (buffer != null) { this.saveOnMark = true; this.mark = false; if (batch != null && batch.getEndRow() <= this.buffer.getRowCount()) { this.batch = null; } } } BatchIterator(BatchProducer source); long available(); void setBuffer(TupleBuffer buffer, boolean saveOnMark); @Override void closeSource(); @Override void reset(); @Override void mark(); @Override void setPosition(long position); boolean ensureSave(); void disableSave(); void readAhead(long limit); TupleBuffer getBuffer(); }
BatchIterator extends AbstractTupleSource { public void disableSave() { if (buffer != null) { this.saveOnMark = true; this.mark = false; if (batch != null && batch.getEndRow() <= this.buffer.getRowCount()) { this.batch = null; } } } BatchIterator(BatchProducer source); long available(); void setBuffer(TupleBuffer buffer, boolean saveOnMark); @Override void closeSource(); @Override void reset(); @Override void mark(); @Override void setPosition(long position); boolean ensureSave(); void disableSave(); void readAhead(long limit); TupleBuffer getBuffer();  }