Package org.apache.drill.exec.work.batch
Class BaseRawBatchBuffer<T>
java.lang.Object
org.apache.drill.exec.work.batch.BaseRawBatchBuffer<T>
- All Implemented Interfaces:
AutoCloseable
,RawFragmentBatchProvider
,RawBatchBuffer
- Direct Known Subclasses:
SpoolingRawBatchBuffer
,UnlimitedRawBatchBuffer
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected BaseRawBatchBuffer.BufferQueue<T>
protected final int
protected final FragmentContext
protected final boolean
protected final AtomicBoolean
-
Constructor Summary
ConstructorDescriptionBaseRawBatchBuffer
(FragmentContext context, int fragmentCount, boolean enableDynamicFC) -
Method Summary
Modifier and TypeMethodDescriptionvoid
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 batchprotected int
Return the fragment count from construction time.getNext()
protected boolean
void
kill
(FragmentContext context) protected abstract void
upkeep
(RawFragmentBatch batch) Handle miscellaneous tasks after batch retrieval
-
Field Details
-
bufferQueue
-
bufferSizePerSocket
protected final int bufferSizePerSocket -
outOfMemory
-
context
-
enableDynamicFC
protected final boolean enableDynamicFC
-
-
Constructor Details
-
BaseRawBatchBuffer
-
-
Method Details
-
getFragmentCount
protected int getFragmentCount()Return the fragment count from construction time.- Returns:
- the fragment count
-
enqueue
Description copied from interface:RawBatchBuffer
Add the next new raw fragment batch to the buffer.- Specified by:
enqueue
in interfaceRawBatchBuffer
- Parameters:
batch
- Batch to enqueue- Throws:
IOException
-
enqueueInner
implementation specific method to enqueue batch- Parameters:
batch
-- Throws:
IOException
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceRawFragmentBatchProvider
-
kill
- Specified by:
kill
in interfaceRawFragmentBatchProvider
-
getNext
- Specified by:
getNext
in interfaceRawFragmentBatchProvider
- Throws:
IOException
-
upkeep
Handle miscellaneous tasks after batch retrieval -
isTerminated
protected boolean isTerminated()
-