Interface HsDataView
-
- All Known Subinterfaces:
HsSubpartitionFileReader
- All Known Implementing Classes:
HsSubpartitionConsumerMemoryDataManager,HsSubpartitionFileReaderImpl
public interface HsDataViewA view forHsSubpartitionConsumerto find out what data exists in memory or disk and polling the data.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Optional<ResultSubpartition.BufferAndBacklog>consumeBuffer(int nextBufferToConsume, Collection<Buffer> buffersToRecycle)Try to consume next buffer.intgetBacklog()Get the number of buffers whoseBuffer.DataTypeis buffer.Buffer.DataTypepeekNextToConsumeDataType(int nextBufferToConsume, Collection<Buffer> buffersToRecycle)Get dataType of next buffer to consume.voidreleaseDataView()Release thisHsDataViewwhen related subpartition view is releasing.
-
-
-
Method Detail
-
consumeBuffer
Optional<ResultSubpartition.BufferAndBacklog> consumeBuffer(int nextBufferToConsume, Collection<Buffer> buffersToRecycle) throws Throwable
Try to consume next buffer.Only invoked by consumer thread.
- Parameters:
nextBufferToConsume- next buffer index to consume.buffersToRecycle- buffers to recycle if needed.- Returns:
- If the target buffer does exist, return buffer and next buffer's backlog, otherwise
return
Optional.empty(). - Throws:
Throwable
-
peekNextToConsumeDataType
Buffer.DataType peekNextToConsumeDataType(int nextBufferToConsume, Collection<Buffer> buffersToRecycle)
Get dataType of next buffer to consume.- Parameters:
nextBufferToConsume- next buffer index to consumebuffersToRecycle- buffers to recycle if needed.- Returns:
- next buffer's dataType. If not found in memory, return
Buffer.DataType.NONE.
-
getBacklog
int getBacklog()
Get the number of buffers whoseBuffer.DataTypeis buffer.- Returns:
- backlog of this view's corresponding subpartition.
-
releaseDataView
void releaseDataView()
Release thisHsDataViewwhen related subpartition view is releasing.
-
-