public BatchCollector createBatchCollector() throws TeiidComponentException { return new BatchCollector(this, this.bufferMgr, this.context, false); }
public BatchCollector createBatchCollector() throws TeiidComponentException { return new BatchCollector(this, this.bufferMgr, this.context, false); }
public BatchCollector createBatchCollector() throws TeiidComponentException { return new BatchCollector(this, this.bufferMgr, this.context, false); }
public TupleBuffer getTupleBuffer() throws TeiidComponentException, TeiidProcessingException { if (this.buffer == null) { if (this.iterator instanceof BatchIterator) { throw new AssertionError("cannot buffer the source"); //$NON-NLS-1$ } if (source.hasBuffer()) { this.buffer = source.getBuffer(-1); Assertion.assertTrue(this.buffer.isFinal()); return this.buffer; } if (collector == null) { collector = new BatchCollector(source, source.getBufferManager(), source.getContext(), false); } this.buffer = collector.collectTuples(); } return this.buffer; }
public TupleBuffer getTupleBuffer() throws TeiidComponentException, TeiidProcessingException { if (this.buffer == null) { if (this.iterator instanceof BatchIterator) { throw new AssertionError("cannot buffer the source"); //$NON-NLS-1$ } if (source.hasBuffer()) { this.buffer = source.getBuffer(-1); Assertion.assertTrue(this.buffer.isFinal()); return this.buffer; } if (collector == null) { collector = new BatchCollector(source, source.getBufferManager(), source.getContext(), false); } this.buffer = collector.collectTuples(); } return this.buffer; }
public TupleBuffer getTupleBuffer() throws TeiidComponentException, TeiidProcessingException { if (this.buffer == null) { if (this.iterator instanceof BatchIterator) { throw new AssertionError("cannot buffer the source"); //$NON-NLS-1$ } if (source.hasBuffer()) { this.buffer = source.getBuffer(-1); Assertion.assertTrue(this.buffer.isFinal()); return this.buffer; } if (collector == null) { collector = new BatchCollector(source, source.getBufferManager(), source.getContext(), false); } this.buffer = collector.collectTuples(); } return this.buffer; }
@Test public void testCollect() throws Exception { FakeRelationalNode sourceNode = new FakeRelationalNode(1, new List[] { Arrays.asList(1), Arrays.asList(1), Arrays.asList(1) }, 1); sourceNode.setElements(Arrays.asList(new ElementSymbol("x", null, DataTypeManager.DefaultDataClasses.INTEGER))); BatchCollector bc = new BatchCollector(sourceNode, BufferManagerFactory.getStandaloneBufferManager(), new CommandContext(), false); bc.collectTuples(true); assertEquals(1, bc.getTupleBuffer().getManagedRowCount()); assertEquals(3, bc.collectTuples().getRowCount()); }
/** * Pro-actively pull batches for later use. * There are unfortunately quite a few cases to cover here. */ protected void prefetch(long limit) throws TeiidComponentException, TeiidProcessingException { if (!open) { return; } if (this.buffer == null) { if (this.sortUtility != null) { return; } if (this.iterator != null) { ((BatchIterator)this.iterator).readAhead(limit); return; } if (source.hasBuffer()) { this.buffer = source.getBuffer(-1); return; } if (collector == null) { collector = new BatchCollector(source, source.getBufferManager(), source.getContext(), false); } if (collector.getTupleBuffer() != null && collector.getTupleBuffer().getManagedRowCount() >= limit) { return; } this.buffer = collector.collectTuples(true); } }
/** * Pro-actively pull batches for later use. * There are unfortunately quite a few cases to cover here. */ protected void prefetch(long limit) throws TeiidComponentException, TeiidProcessingException { if (!open) { return; } if (this.buffer == null) { if (this.sortUtility != null) { return; } if (this.iterator != null) { ((BatchIterator)this.iterator).readAhead(limit); return; } if (source.hasBuffer()) { this.buffer = source.getBuffer(-1); return; } if (collector == null) { collector = new BatchCollector(source, source.getBufferManager(), source.getContext(), false); } if (collector.getTupleBuffer() != null && collector.getTupleBuffer().getManagedRowCount() >= limit) { return; } this.buffer = collector.collectTuples(true); } }
/** * Pro-actively pull batches for later use. * There are unfortunately quite a few cases to cover here. */ protected void prefetch(long limit) throws TeiidComponentException, TeiidProcessingException { if (!open) { return; } if (this.buffer == null) { if (this.sortUtility != null) { return; } if (this.iterator != null) { ((BatchIterator)this.iterator).readAhead(limit); return; } if (source.hasBuffer()) { this.buffer = source.getBuffer(-1); return; } if (collector == null) { collector = new BatchCollector(source, source.getBufferManager(), source.getContext(), false); } if (collector.getTupleBuffer() != null && collector.getTupleBuffer().getManagedRowCount() >= limit) { return; } this.buffer = collector.collectTuples(true); } }