Interface RecordCollector
-
- All Known Implementing Classes:
RecordCollectorImpl
public interface RecordCollector
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
RecordCollector.Supplier
A supplier of aRecordCollectorImpl
instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
Close the internalProducer
.void
flush()
Flush the internalProducer
.void
init(org.apache.kafka.clients.producer.Producer<byte[],byte[]> producer)
Initialize the collector with a producer.java.util.Map<org.apache.kafka.common.TopicPartition,java.lang.Long>
offsets()
The last acked offsets from the internalProducer
.<K,V>
voidsend(java.lang.String topic, K key, V value, org.apache.kafka.common.header.Headers headers, java.lang.Integer partition, java.lang.Long timestamp, org.apache.kafka.common.serialization.Serializer<K> keySerializer, org.apache.kafka.common.serialization.Serializer<V> valueSerializer)
<K,V>
voidsend(java.lang.String topic, K key, V value, org.apache.kafka.common.header.Headers headers, java.lang.Long timestamp, org.apache.kafka.common.serialization.Serializer<K> keySerializer, org.apache.kafka.common.serialization.Serializer<V> valueSerializer, StreamPartitioner<? super K,? super V> partitioner)
-
-
-
Method Detail
-
send
<K,V> void send(java.lang.String topic, K key, V value, org.apache.kafka.common.header.Headers headers, java.lang.Integer partition, java.lang.Long timestamp, org.apache.kafka.common.serialization.Serializer<K> keySerializer, org.apache.kafka.common.serialization.Serializer<V> valueSerializer)
-
send
<K,V> void send(java.lang.String topic, K key, V value, org.apache.kafka.common.header.Headers headers, java.lang.Long timestamp, org.apache.kafka.common.serialization.Serializer<K> keySerializer, org.apache.kafka.common.serialization.Serializer<V> valueSerializer, StreamPartitioner<? super K,? super V> partitioner)
-
init
void init(org.apache.kafka.clients.producer.Producer<byte[],byte[]> producer)
Initialize the collector with a producer.- Parameters:
producer
- the producer that should be used by this collector
-
flush
void flush()
Flush the internalProducer
.
-
close
void close()
Close the internalProducer
.
-
offsets
java.util.Map<org.apache.kafka.common.TopicPartition,java.lang.Long> offsets()
The last acked offsets from the internalProducer
.- Returns:
- the map from TopicPartition to offset
-
-