public abstract class AbstractDataCollector extends Object implements DataCollector
| Modifier and Type | Field and Description |
|---|---|
protected RawBatchBuffer[] |
buffers |
protected ArrayWrappedIntIntMap |
fragmentMap |
protected BufferAllocator |
ownerAllocator
Allocator which owns incoming batches
|
logger| Constructor and Description |
|---|
AbstractDataCollector(AtomicInteger parentAccounter,
int numBuffers,
BitControl.Collector collector,
int bufferCapacity,
FragmentContext context) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
batchArrived(int minorFragmentId,
RawFragmentBatch batch) |
void |
close() |
BufferAllocator |
getAllocator() |
protected abstract RawBatchBuffer |
getBuffer(int minorFragmentId) |
RawBatchBuffer[] |
getBuffers() |
int |
getOppositeMajorFragmentId() |
int |
getTotalIncomingFragments() |
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.
|
protected final RawBatchBuffer[] buffers
protected final ArrayWrappedIntIntMap fragmentMap
protected BufferAllocator ownerAllocator
public AbstractDataCollector(AtomicInteger parentAccounter, int numBuffers, BitControl.Collector collector, int bufferCapacity, FragmentContext context)
parentAccounter - numBuffers - Number of RawBatchBuffer inputs required to store the incoming databufferCapacity - Capacity of each RawBatchBuffer.context - public int getOppositeMajorFragmentId()
getOppositeMajorFragmentId in interface DataCollectorpublic RawBatchBuffer[] getBuffers()
getBuffers in interface DataCollectorpublic boolean batchArrived(int minorFragmentId,
RawFragmentBatch batch)
throws IOException
batchArrived in interface DataCollectorIOExceptionpublic int getTotalIncomingFragments()
getTotalIncomingFragments in interface DataCollectorprotected abstract RawBatchBuffer getBuffer(int minorFragmentId)
public void close()
throws Exception
close in interface AutoCloseableclose in interface DataCollectorExceptionpublic BufferAllocator getAllocator()
getAllocator in interface DataCollectorpublic void setAllocator(BufferAllocator allocator)
setAllocator in interface DataCollectorallocator - operator buffer allocatorCopyright © 2021 The Apache Software Foundation. All rights reserved.