public class HsSubpartitionConsumerMemoryDataManager extends Object implements HsDataView
HsSubpartitionMemoryDataManager will create a new HsSubpartitionConsumerMemoryDataManager when a consumer is registered.| Constructor and Description |
|---|
HsSubpartitionConsumerMemoryDataManager(Lock resultPartitionLock,
Lock consumerLock,
int subpartitionId,
HsConsumerId consumerId,
HsMemoryDataManagerOperation memoryDataManagerOperation) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addBuffer(HsBufferContext bufferContext) |
void |
addInitialBuffers(Deque<HsBufferContext> buffers) |
Optional<ResultSubpartition.BufferAndBacklog> |
consumeBuffer(int toConsumeIndex)
Check whether the head of
unConsumedBuffers is the buffer to be consumed. |
int |
getBacklog()
Get the number of buffers backlog.
|
Buffer.DataType |
peekNextToConsumeDataType(int nextToConsumeIndex)
Check whether the head of
unConsumedBuffers is the buffer to be consumed next time. |
void |
releaseDataView()
Release this
HsDataView when related subpartition view is releasing. |
public HsSubpartitionConsumerMemoryDataManager(Lock resultPartitionLock, Lock consumerLock, int subpartitionId, HsConsumerId consumerId, HsMemoryDataManagerOperation memoryDataManagerOperation)
public void addInitialBuffers(Deque<HsBufferContext> buffers)
public boolean addBuffer(HsBufferContext bufferContext)
public Optional<ResultSubpartition.BufferAndBacklog> consumeBuffer(int toConsumeIndex)
unConsumedBuffers is the buffer to be consumed. If so,
return the buffer and backlog.consumeBuffer in interface HsDataViewtoConsumeIndex - index of buffer to be consumed.unConsumedBuffers is target, return optional of the buffer
and backlog. Otherwise, return Optional.empty().public Buffer.DataType peekNextToConsumeDataType(int nextToConsumeIndex)
unConsumedBuffers is the buffer to be consumed next time.
If so, return the next buffer's data type.peekNextToConsumeDataType in interface HsDataViewnextToConsumeIndex - index of the buffer to be consumed next time.unConsumedBuffers is target, return the buffer's data type.
Otherwise, return Buffer.DataType#NONE.public int getBacklog()
HsDataViewgetBacklog in interface HsDataViewpublic void releaseDataView()
HsDataViewHsDataView when related subpartition view is releasing.releaseDataView in interface HsDataViewCopyright © 2014–2023 The Apache Software Foundation. All rights reserved.