Class RecordCollectorImpl

    • Constructor Summary

      Constructors 
      Constructor Description
      RecordCollectorImpl​(java.lang.String streamTaskId, org.apache.kafka.common.utils.LogContext logContext, ProductionExceptionHandler productionExceptionHandler, org.apache.kafka.common.metrics.Sensor skippedRecordsSensor)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Close the internal Producer.
      void flush()
      Flush the internal Producer.
      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 internal Producer.
      <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)  
      <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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RecordCollectorImpl

        public RecordCollectorImpl​(java.lang.String streamTaskId,
                                   org.apache.kafka.common.utils.LogContext logContext,
                                   ProductionExceptionHandler productionExceptionHandler,
                                   org.apache.kafka.common.metrics.Sensor skippedRecordsSensor)
    • Method Detail

      • init

        public void init​(org.apache.kafka.clients.producer.Producer<byte[],​byte[]> producer)
        Description copied from interface: RecordCollector
        Initialize the collector with a producer.
        Specified by:
        init in interface RecordCollector
        Parameters:
        producer - the producer that should be used by this collector
      • 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:
        send in interface RecordCollector
      • 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:
        send in interface RecordCollector
      • offsets

        public java.util.Map<org.apache.kafka.common.TopicPartition,​java.lang.Long> offsets()
        Description copied from interface: RecordCollector
        The last acked offsets from the internal Producer.
        Specified by:
        offsets in interface RecordCollector
        Returns:
        the map from TopicPartition to offset