Interface ProducerPool
-
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
ProducerPoolImpl
@Internal public interface ProducerPool extends AutoCloseable
A pool of producers that can be recycled.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Collection<CheckpointTransaction>getOngoingTransactions()Returns a snapshot of all ongoing transactions.FlinkKafkaInternalProducer<byte[],byte[]>getTransactionalProducer(String transactionalId, long checkpointId)Get a producer for the given transactional id and checkpoint id.voidrecycle(FlinkKafkaInternalProducer<byte[],byte[]> producer)Explicitly recycle a producer.voidrecycleByTransactionId(String transactionalId, boolean success)Notify the pool that a transaction has finished.-
Methods inherited from interface java.lang.AutoCloseable
close
-
-
-
-
Method Detail
-
recycleByTransactionId
void recycleByTransactionId(String transactionalId, boolean success)
Notify the pool that a transaction has finished. The producer with the given transactional id can be recycled.
-
getTransactionalProducer
FlinkKafkaInternalProducer<byte[],byte[]> getTransactionalProducer(String transactionalId, long checkpointId)
Get a producer for the given transactional id and checkpoint id. The producer is not recycled until it is passed to the committer, the committer commits the transaction, andrecycleByTransactionId(String, boolean)is called. Alternatively, the producer can be recycled byrecycle(FlinkKafkaInternalProducer).
-
getOngoingTransactions
Collection<CheckpointTransaction> getOngoingTransactions()
Returns a snapshot of all ongoing transactions.
-
recycle
void recycle(FlinkKafkaInternalProducer<byte[],byte[]> producer)
Explicitly recycle a producer. This is useful when the producer has not been passed to the committer.
-
-