public interface BufferAccumulator extends AutoCloseable
BufferAccumulator receives the records
from tiered store producer and the records will accumulate and transform into buffers.| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the accumulator.
|
void |
receive(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.
|
void |
setup(java.util.function.BiConsumer<TieredStorageSubpartitionId,List<Buffer>> bufferFlusher)
Setup the accumulator.
|
void setup(java.util.function.BiConsumer<TieredStorageSubpartitionId,List<Buffer>> bufferFlusher)
bufferFlusher - accepts the accumulated buffers. The first field is the subpartition id,
while the list in the second field contains accumulated buffers in order for that
subpartition.void receive(ByteBuffer record, TieredStorageSubpartitionId subpartitionId, Buffer.DataType dataType, boolean isBroadcast) throws IOException
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.
record - the received recordsubpartitionId - the subpartition id of the recorddataType - the data type of the recordisBroadcast - whether the record is a broadcast recordIOExceptionvoid close()
close in interface AutoCloseableCopyright © 2014–2023 The Apache Software Foundation. All rights reserved.