Package org.apache.drill.exec.work.batch
Class AbstractDataCollector
java.lang.Object
org.apache.drill.exec.work.batch.AbstractDataCollector
- All Implemented Interfaces:
AutoCloseable
,DataCollector
- Direct Known Subclasses:
MergingCollector
,PartitionedCollector
-
Field Summary
Modifier and TypeFieldDescriptionprotected final RawBatchBuffer[]
protected final ArrayWrappedIntIntMap
protected BufferAllocator
Allocator which owns incoming batchesFields inherited from interface org.apache.drill.exec.work.batch.DataCollector
logger
-
Constructor Summary
ConstructorDescriptionAbstractDataCollector
(AtomicInteger parentAccounter, int numBuffers, BitControl.Collector collector, int bufferCapacity, FragmentContext context) -
Method Summary
Modifier and TypeMethodDescriptionboolean
batchArrived
(int minorFragmentId, RawFragmentBatch batch) void
close()
protected abstract RawBatchBuffer
getBuffer
(int minorFragmentId) int
int
void
setAllocator
(BufferAllocator allocator) Enables caller (e.g., receiver) to attach its buffer allocator to this Data Collector in order to claim ownership of incoming batches; by default, the fragment allocator owns these batches.
-
Field Details
-
buffers
-
fragmentMap
-
ownerAllocator
Allocator which owns incoming batches
-
-
Constructor Details
-
AbstractDataCollector
public AbstractDataCollector(AtomicInteger parentAccounter, int numBuffers, BitControl.Collector collector, int bufferCapacity, FragmentContext context) - Parameters:
parentAccounter
-numBuffers
- Number of RawBatchBuffer inputs required to store the incoming databufferCapacity
- Capacity of each RawBatchBuffer.context
-
-
-
Method Details
-
getOppositeMajorFragmentId
public int getOppositeMajorFragmentId()- Specified by:
getOppositeMajorFragmentId
in interfaceDataCollector
-
getBuffers
- Specified by:
getBuffers
in interfaceDataCollector
-
batchArrived
- Specified by:
batchArrived
in interfaceDataCollector
- Throws:
IOException
-
getTotalIncomingFragments
public int getTotalIncomingFragments()- Specified by:
getTotalIncomingFragments
in interfaceDataCollector
-
getBuffer
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceDataCollector
- Throws:
Exception
-
getAllocator
- Specified by:
getAllocator
in interfaceDataCollector
- Returns:
- allocator
-
setAllocator
Enables caller (e.g., receiver) to attach its buffer allocator to this Data Collector in order to claim ownership of incoming batches; by default, the fragment allocator owns these batches.- Specified by:
setAllocator
in interfaceDataCollector
- Parameters:
allocator
- operator buffer allocator
-