Class RecordCollectorImpl
- java.lang.Object
-
- org.apache.kafka.streams.processor.internals.RecordCollectorImpl
-
- All Implemented Interfaces:
RecordCollector
public class RecordCollectorImpl extends java.lang.Object implements RecordCollector
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.kafka.streams.processor.internals.RecordCollector
RecordCollector.Supplier
-
-
Constructor Summary
Constructors Constructor Description RecordCollectorImpl(org.apache.kafka.common.utils.LogContext logContext, TaskId taskId, StreamsProducer streamsProducer, ProductionExceptionHandler productionExceptionHandler, StreamsMetricsImpl streamsMetrics)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseClean()Clean close the internalProducer.voidcloseDirty()Dirty close the internalProducer.voidflush()Flush the internalProducer.voidinitialize()Initialize the internalProducer; note this function should be made idempotentjava.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)
-
-
-
Constructor Detail
-
RecordCollectorImpl
public RecordCollectorImpl(org.apache.kafka.common.utils.LogContext logContext, TaskId taskId, StreamsProducer streamsProducer, ProductionExceptionHandler productionExceptionHandler, StreamsMetricsImpl streamsMetrics)- Throws:
StreamsException- fatal error that should cause the thread to die (from producer.initTxn)
-
-
Method Detail
-
initialize
public void initialize()
Description copied from interface:RecordCollectorInitialize the internalProducer; note this function should be made idempotent- Specified by:
initializein interfaceRecordCollector
-
send
public <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)- Specified by:
sendin interfaceRecordCollector- Throws:
StreamsException- fatal error that should cause the thread to dieTaskMigratedException- recoverable error that would cause the task to be removed
-
send
public <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)- Specified by:
sendin interfaceRecordCollector
-
flush
public void flush()
Description copied from interface:RecordCollectorFlush the internalProducer.- Specified by:
flushin interfaceRecordCollector- Throws:
StreamsException- fatal error that should cause the thread to dieTaskMigratedException- recoverable error that would cause the task to be removed
-
closeClean
public void closeClean()
Description copied from interface:RecordCollectorClean close the internalProducer.- Specified by:
closeCleanin interfaceRecordCollector- Throws:
StreamsException- fatal error that should cause the thread to dieTaskMigratedException- recoverable error that would cause the task to be removed
-
closeDirty
public void closeDirty()
Description copied from interface:RecordCollectorDirty close the internalProducer.- Specified by:
closeDirtyin interfaceRecordCollector- Throws:
StreamsException- fatal error that should cause the thread to dieTaskMigratedException- recoverable error that would cause the task to be removed
-
offsets
public java.util.Map<org.apache.kafka.common.TopicPartition,java.lang.Long> offsets()
Description copied from interface:RecordCollectorThe last acked offsets from the internalProducer.- Specified by:
offsetsin interfaceRecordCollector- Returns:
- an immutable map from TopicPartition to offset
-
-