public class TieredStorageProducerClient extends Object
Constructor and Description |
---|
TieredStorageProducerClient(int numSubpartitions,
boolean isBroadcastOnly,
BufferAccumulator bufferAccumulator,
BufferCompressor bufferCompressor,
List<TierProducerAgent> tierProducerAgents) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
setMetricStatisticsUpdater(java.util.function.Consumer<TieredStorageProducerMetricUpdate> metricStatisticsUpdater) |
void |
write(ByteBuffer record,
TieredStorageSubpartitionId subpartitionId,
Buffer.DataType dataType,
boolean isBroadcast)
Write records to the producer client.
|
public TieredStorageProducerClient(int numSubpartitions, boolean isBroadcastOnly, BufferAccumulator bufferAccumulator, @Nullable BufferCompressor bufferCompressor, List<TierProducerAgent> tierProducerAgents)
public void write(ByteBuffer record, TieredStorageSubpartitionId subpartitionId, Buffer.DataType dataType, boolean isBroadcast) throws IOException
BufferAccumulator
will accumulate the
records into buffers.
Note that isBroadcast indicates whether the record is broadcast, while isBroadcastOnly indicates whether the result partition is broadcast-only. When the result partition is not broadcast-only and the record is a broadcast record, the record will be written to all the subpartitions.
record
- the written record datasubpartitionId
- the subpartition identifierdataType
- the data type of the recordisBroadcast
- whether the record is a broadcast recordIOException
public void setMetricStatisticsUpdater(java.util.function.Consumer<TieredStorageProducerMetricUpdate> metricStatisticsUpdater)
public void close()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.