Interface BufferAccumulator
-
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
HashBufferAccumulator,SortBufferAccumulator
public interface BufferAccumulator extends AutoCloseable
Accumulates received records into buffers. TheBufferAccumulatorreceives the records from tiered store producer and the records will accumulate and transform into buffers.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Close the accumulator.voidreceive(ByteBuffer record, TieredStorageSubpartitionId subpartitionId, Buffer.DataType dataType, boolean isBroadcast)Receives the records from tiered store producer, these records will be accumulated and transformed into finished buffers.voidsetup(org.apache.flink.util.function.TriConsumer<TieredStorageSubpartitionId,Buffer,Integer> bufferFlusher)Setup the accumulator.
-
-
-
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 recordsubpartitionId- the subpartition id of the recorddataType- the data type of the recordisBroadcast- 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:
closein interfaceAutoCloseable
-
-