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
FieldsModifier and TypeFieldDescriptionprotected final RawBatchBuffer[]protected final ArrayWrappedIntIntMapprotected BufferAllocatorAllocator which owns incoming batchesFields inherited from interface org.apache.drill.exec.work.batch.DataCollector
logger -
Constructor Summary
ConstructorsConstructorDescriptionAbstractDataCollector(AtomicInteger parentAccounter, int numBuffers, BitControl.Collector collector, int bufferCapacity, FragmentContext context) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbatchArrived(int minorFragmentId, RawFragmentBatch batch) voidclose()protected abstract RawBatchBuffergetBuffer(int minorFragmentId) intintvoidsetAllocator(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:
getOppositeMajorFragmentIdin interfaceDataCollector
-
getBuffers
- Specified by:
getBuffersin interfaceDataCollector
-
batchArrived
- Specified by:
batchArrivedin interfaceDataCollector- Throws:
IOException
-
getTotalIncomingFragments
public int getTotalIncomingFragments()- Specified by:
getTotalIncomingFragmentsin interfaceDataCollector
-
getBuffer
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceDataCollector- Throws:
Exception
-
getAllocator
- Specified by:
getAllocatorin 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:
setAllocatorin interfaceDataCollector- Parameters:
allocator- operator buffer allocator
-