public class HsSubpartitionMemoryDataManager extends Object implements HsDataView
HsMemoryDataManager will hold multiple HsSubpartitionMemoryDataManager.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 在接口中 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 Optional<ResultSubpartition.BufferAndBacklog> consumeBuffer(int toConsumeIndex)
unConsumedBuffers is the buffer to be consumed. If so,
return the buffer and backlog.consumeBuffer 在接口中 HsDataViewtoConsumeIndex - index of buffer to be consumed.unConsumedBuffers is target, return optional of the buffer
and backlog. Otherwise, return Optional.empty().public int getBacklog()
HsDataViewgetBacklog 在接口中 HsDataViewpublic void releaseDataView()
HsDataViewHsDataView when related subpartition view is releasing.releaseDataView 在接口中 HsDataViewpublic void append(ByteBuffer record, Buffer.DataType dataType) throws InterruptedException
HsSubpartitionMemoryDataManager.record - to be managed by this class.dataType - the type of this record. In other words, is it data or event.InterruptedExceptionpublic Deque<BufferIndexAndChannel> getBuffersSatisfyStatus(HsSpillingInfoProvider.SpillStatus spillStatus, HsSpillingInfoProvider.ConsumeStatus consumeStatus)
allBuffers that satisfy expected HsSpillingInfoProvider.SpillStatus and HsSpillingInfoProvider.ConsumeStatus.spillStatus - the status of spilling expected.consumeStatus - the status of consuming expected.public List<BufferWithIdentity> spillSubpartitionBuffers(List<BufferIndexAndChannel> toSpill, CompletableFuture<Void> spillDoneFuture)
toSpill - All buffers that need to be spilled belong to this subpartition in a decision.spillDoneFuture - completed when spill is finished.BufferWithIdentitys about these spill buffers.public void releaseSubpartitionBuffers(List<BufferIndexAndChannel> toRelease)
toRelease - All buffers that need to be released belong to this subpartition in a
decision.public void setOutputMetrics(HsOutputMetrics outputMetrics)
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.