Class HsSubpartitionMemoryDataManager
- java.lang.Object
-
- org.apache.flink.runtime.io.network.partition.hybrid.HsSubpartitionMemoryDataManager
-
public class HsSubpartitionMemoryDataManager extends Object
This class is responsible for managing the data in a single subpartition. OneHsMemoryDataManagerwill hold multipleHsSubpartitionMemoryDataManager.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappend(ByteBuffer record, Buffer.DataType dataType)Append record toHsSubpartitionMemoryDataManager.Deque<BufferIndexAndChannel>getBuffersSatisfyStatus(HsSpillingInfoProvider.SpillStatus spillStatus, HsSpillingInfoProvider.ConsumeStatusWithId consumeStatusWithId)Get buffers inallBuffersthat satisfy expectedHsSpillingInfoProvider.SpillStatusandHsSpillingInfoProvider.ConsumeStatus.HsSubpartitionConsumerMemoryDataManagerregisterNewConsumer(HsConsumerId consumerId)voidreleaseConsumer(HsConsumerId consumerId)voidreleaseSubpartitionBuffers(List<BufferIndexAndChannel> toRelease)Release this subpartition's buffers in a decision.voidsetOutputMetrics(HsOutputMetrics outputMetrics)List<BufferWithIdentity>spillSubpartitionBuffers(List<BufferIndexAndChannel> toSpill, CompletableFuture<Void> spillDoneFuture)Spill this subpartition's buffers in a decision.
-
-
-
Method Detail
-
append
public void append(ByteBuffer record, Buffer.DataType dataType) throws InterruptedException
Append record toHsSubpartitionMemoryDataManager.- Parameters:
record- to be managed by this class.dataType- the type of this record. In other words, is it data or event.- Throws:
InterruptedException
-
getBuffersSatisfyStatus
public Deque<BufferIndexAndChannel> getBuffersSatisfyStatus(HsSpillingInfoProvider.SpillStatus spillStatus, HsSpillingInfoProvider.ConsumeStatusWithId consumeStatusWithId)
Get buffers inallBuffersthat satisfy expectedHsSpillingInfoProvider.SpillStatusandHsSpillingInfoProvider.ConsumeStatus.- Parameters:
spillStatus- the status of spilling expected.consumeStatusWithId- the status and consumerId expected.- Returns:
- buffers satisfy expected status in order.
-
spillSubpartitionBuffers
public List<BufferWithIdentity> spillSubpartitionBuffers(List<BufferIndexAndChannel> toSpill, CompletableFuture<Void> spillDoneFuture)
Spill this subpartition's buffers in a decision.- Parameters:
toSpill- All buffers that need to be spilled belong to this subpartition in a decision.spillDoneFuture- completed when spill is finished.- Returns:
BufferWithIdentitys about these spill buffers.
-
releaseSubpartitionBuffers
public void releaseSubpartitionBuffers(List<BufferIndexAndChannel> toRelease)
Release this subpartition's buffers in a decision.- Parameters:
toRelease- All buffers that need to be released belong to this subpartition in a decision.
-
setOutputMetrics
public void setOutputMetrics(HsOutputMetrics outputMetrics)
-
registerNewConsumer
public HsSubpartitionConsumerMemoryDataManager registerNewConsumer(HsConsumerId consumerId)
-
releaseConsumer
public void releaseConsumer(HsConsumerId consumerId)
-
-