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 AtomicBoolean |
outOfMemory |
| Constructor and Description |
|---|
BaseRawBatchBuffer(FragmentContext context,
int fragmentCount) |
| 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
public BaseRawBatchBuffer(FragmentContext context, int fragmentCount)
protected int getFragmentCount()
public void enqueue(RawFragmentBatch batch) throws IOException
RawBatchBufferenqueue in interface RawBatchBufferbatch - Batch to enqueueIOExceptionprotected abstract void enqueueInner(RawFragmentBatch batch) throws IOException
batch - IOExceptionpublic void close()
close in interface AutoCloseableclose in interface RawFragmentBatchProviderpublic void kill(FragmentContext context)
kill in interface RawFragmentBatchProviderpublic RawFragmentBatch getNext() throws IOException
getNext in interface RawFragmentBatchProviderIOExceptionprotected abstract void upkeep(RawFragmentBatch batch)
protected boolean isTerminated()
Copyright © 2017 The Apache Software Foundation. All rights reserved.