Search in sources :

Example 6 with IncomingBuffers

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

the class UnorderedReceiverCreator method getBatch.

@SuppressWarnings("resource")
@Override
public UnorderedReceiverBatch getBatch(ExecutorFragmentContext 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)

Example 7 with IncomingBuffers

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

the class MergingReceiverCreator method getBatch.

@Override
public MergingRecordBatch getBatch(ExecutorFragmentContext 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.getCollector(receiver.getOppositeMajorFragmentId()).getBuffers();
    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)

Aggregations

IncomingBuffers (org.apache.drill.exec.work.batch.IncomingBuffers)7 RawBatchBuffer (org.apache.drill.exec.work.batch.RawBatchBuffer)6 MergingRecordBatch (org.apache.drill.exec.physical.impl.mergereceiver.MergingRecordBatch)3 FragmentContext (org.apache.drill.exec.ops.FragmentContext)1 ControlTunnel (org.apache.drill.exec.rpc.control.ControlTunnel)1 FragmentExecutor (org.apache.drill.exec.work.fragment.FragmentExecutor)1 FragmentStatusReporter (org.apache.drill.exec.work.fragment.FragmentStatusReporter)1 RootFragmentManager (org.apache.drill.exec.work.fragment.RootFragmentManager)1