public class HsSubpartitionConsumerMemoryDataManager extends Object implements HsDataView
HsSubpartitionMemoryDataManager will create a new HsSubpartitionConsumerMemoryDataManager when a consumer is registered.| 构造器和说明 |
|---|
HsSubpartitionConsumerMemoryDataManager(Lock resultPartitionLock,
Lock consumerLock,
int subpartitionId,
HsConsumerId consumerId,
HsMemoryDataManagerOperation memoryDataManagerOperation) |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
addBuffer(HsBufferContext bufferContext) |
void |
addInitialBuffers(Deque<HsBufferContext> buffers) |
Optional<ResultSubpartition.BufferAndBacklog> |
consumeBuffer(int toConsumeIndex,
Collection<Buffer> buffersToRecycle)
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,
Collection<Buffer> buffersToRecycle)
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, Collection<Buffer> buffersToRecycle)
unConsumedBuffers is the buffer to be consumed. If so,
return the buffer and backlog.consumeBuffer 在接口中 HsDataViewtoConsumeIndex - index of buffer to be consumed.buffersToRecycle - buffers to recycle if needed.unConsumedBuffers is target, return optional of the buffer
and backlog. Otherwise, return Optional.empty().public Buffer.DataType peekNextToConsumeDataType(int nextToConsumeIndex, Collection<Buffer> buffersToRecycle)
unConsumedBuffers is the buffer to be consumed next time.
If so, return the next buffer's data type.peekNextToConsumeDataType 在接口中 HsDataViewnextToConsumeIndex - index of the buffer to be consumed next time.buffersToRecycle - buffers to recycle if needed.unConsumedBuffers is target, return the buffer's data type.
Otherwise, return Buffer.DataType#NONE.public int getBacklog()
HsDataViewgetBacklog 在接口中 HsDataViewpublic void releaseDataView()
HsDataViewHsDataView when related subpartition view is releasing.releaseDataView 在接口中 HsDataViewCopyright © 2014–2023 The Apache Software Foundation. All rights reserved.