java.lang.Object
org.apache.flink.runtime.io.network.partition.hybrid.tiered.storage.HashBufferAccumulator
All Implemented Interfaces:
AutoCloseable, BufferAccumulator, HashSubpartitionBufferAccumulatorContext

public class HashBufferAccumulator extends Object implements BufferAccumulator, HashSubpartitionBufferAccumulatorContext
The hash implementation of the BufferAccumulator. The BufferAccumulator receives the records from TieredStorageProducerClient and the records will accumulate and transform to finished buffers. The accumulated buffers will be transferred to the corresponding tier dynamically.

To avoid the buffer waiting deadlock between the subpartitions, the HashBufferAccumulator requires at least n buffers (n is the number of subpartitions) to make sure that each subpartition has at least one buffer to accumulate the receiving data. Once an accumulated buffer is finished, the buffer will be flushed immediately.

Note that this class need not be thread-safe, because it should only be accessed from the main thread.

  • Constructor Details

    • HashBufferAccumulator

      public HashBufferAccumulator(int numSubpartitions, int bufferSize, TieredStorageMemoryManager memoryManager, boolean isPartialRecordAllowed)
  • Method Details