Interface BufferAccumulator

    • Method Detail

      • setup

        void setup​(org.apache.flink.util.function.TriConsumer<TieredStorageSubpartitionId,​Buffer,​Integer> bufferFlusher)
        Setup the accumulator.
        Parameters:
        bufferFlusher - accepts the accumulated buffers. The first field is the subpartition id, the second is the accumulated buffer to flush, and the third is the number of remaining buffers to be written consecutively to the same segment.
      • receive

        void receive​(ByteBuffer record,
                     TieredStorageSubpartitionId subpartitionId,
                     Buffer.DataType dataType,
                     boolean isBroadcast)
              throws IOException
        Receives the records from tiered store producer, these records will be accumulated and transformed into finished buffers.

        Note that when isBroadcast is true, for a broadcast-only partition, the subpartitionId value will always be 0. Conversely, for a non-broadcast-only partition, the subpartitionId value will range from 0 to the number of subpartitions.

        Parameters:
        record - the received record
        subpartitionId - the subpartition id of the record
        dataType - the data type of the record
        isBroadcast - whether the record is a broadcast record
        Throws:
        IOException
      • close

        void close()
        Close the accumulator. This will flush all the remaining data and release all the resources.
        Specified by:
        close in interface AutoCloseable