public abstract class BaseRawBatchBuffer<T> extends Object implements RawBatchBuffer
Modifier and Type | Class and Description |
---|---|
protected static interface |
BaseRawBatchBuffer.BufferQueue<T> |
Modifier and Type | Field and Description |
---|---|
protected BaseRawBatchBuffer.BufferQueue<T> |
bufferQueue |
protected int |
bufferSizePerSocket |
protected FragmentContext |
context |
protected boolean |
enableDynamicFC |
protected AtomicBoolean |
outOfMemory |
Constructor and Description |
---|
BaseRawBatchBuffer(FragmentContext context,
int fragmentCount,
boolean enableDynamicFC) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
enqueue(RawFragmentBatch batch)
Add the next new raw fragment batch to the buffer.
|
protected abstract void |
enqueueInner(RawFragmentBatch batch)
implementation specific method to enqueue batch
|
protected int |
getFragmentCount()
Return the fragment count from construction time.
|
RawFragmentBatch |
getNext() |
protected boolean |
isTerminated() |
void |
kill(FragmentContext context) |
protected abstract void |
upkeep(RawFragmentBatch batch)
Handle miscellaneous tasks after batch retrieval
|
protected BaseRawBatchBuffer.BufferQueue<T> bufferQueue
protected final int bufferSizePerSocket
protected final AtomicBoolean outOfMemory
protected final FragmentContext context
protected final boolean enableDynamicFC
public BaseRawBatchBuffer(FragmentContext context, int fragmentCount, boolean enableDynamicFC)
protected int getFragmentCount()
public void enqueue(RawFragmentBatch batch) throws IOException
RawBatchBuffer
enqueue
in interface RawBatchBuffer
batch
- Batch to enqueueIOException
protected abstract void enqueueInner(RawFragmentBatch batch) throws IOException
batch
- IOException
public void close()
close
in interface AutoCloseable
close
in interface RawFragmentBatchProvider
public void kill(FragmentContext context)
kill
in interface RawFragmentBatchProvider
public RawFragmentBatch getNext() throws IOException
getNext
in interface RawFragmentBatchProvider
IOException
protected abstract void upkeep(RawFragmentBatch batch)
protected boolean isTerminated()
Copyright © 1970 The Apache Software Foundation. All rights reserved.