Search in sources :

Example 1 with RawBatchBuffer

use of org.apache.drill.exec.work.batch.RawBatchBuffer in project drill by apache.

the class MergingReceiverCreator method getBatch.

@Override
public MergingRecordBatch getBatch(FragmentContext context, MergingReceiverPOP receiver, List<RecordBatch> children) throws ExecutionSetupException, OutOfMemoryException {
    assert children == null || children.isEmpty();
    IncomingBuffers bufHolder = context.getBuffers();
    assert bufHolder != null : "IncomingBuffers must be defined for any place a receiver is declared.";
    RawBatchBuffer[] buffers = bufHolder.getBuffers(receiver.getOppositeMajorFragmentId());
    return new MergingRecordBatch(context, receiver, buffers);
}
Also used : IncomingBuffers(org.apache.drill.exec.work.batch.IncomingBuffers) MergingRecordBatch(org.apache.drill.exec.physical.impl.mergereceiver.MergingRecordBatch) RawBatchBuffer(org.apache.drill.exec.work.batch.RawBatchBuffer)

Example 2 with RawBatchBuffer

use of org.apache.drill.exec.work.batch.RawBatchBuffer in project drill by apache.

the class UnorderedReceiverCreator method getBatch.

@Override
public UnorderedReceiverBatch getBatch(FragmentContext context, UnorderedReceiver receiver, List<RecordBatch> children) throws ExecutionSetupException {
    assert children == null || children.isEmpty();
    IncomingBuffers bufHolder = context.getBuffers();
    assert bufHolder != null : "IncomingBuffers must be defined for any place a receiver is declared.";
    RawBatchBuffer[] buffers = bufHolder.getBuffers(receiver.getOppositeMajorFragmentId());
    assert buffers.length == 1;
    RawBatchBuffer buffer = buffers[0];
    return new UnorderedReceiverBatch(context, buffer, receiver);
}
Also used : IncomingBuffers(org.apache.drill.exec.work.batch.IncomingBuffers) RawBatchBuffer(org.apache.drill.exec.work.batch.RawBatchBuffer)

Aggregations

IncomingBuffers (org.apache.drill.exec.work.batch.IncomingBuffers)2 RawBatchBuffer (org.apache.drill.exec.work.batch.RawBatchBuffer)2 MergingRecordBatch (org.apache.drill.exec.physical.impl.mergereceiver.MergingRecordBatch)1