RecordCollector Contract

RecordCollector is the contract of record collectors that can send a record to a topic.

Table 1. RecordCollector Contract
Method Description

close

void close()

Closes the RecordCollector

Used when…​FIXME

flush

void flush()

Flushes the RecordCollector (and the internal Kafka producer)

Used exclusively when StreamTask is requested to flush state stores and the internal Kafka producer

init

void init(
  Producer<byte[], byte[]> producer)

Initializes the RecordCollector (with a Kafka Producer)

Used when StreamTask is created and resumed

offsets

Map<TopicPartition, Long> offsets()

Used exclusively when StreamTask is requested to activeTaskCheckpointableOffsets

send

<K, V> void send(
  String topic,
  K key,
  V value,
  Headers headers,
  Integer partition,
  Long timestamp,
  Serializer<K> keySerializer,
  Serializer<V> valueSerializer)
<K, V> void send(
  String topic,
  K key,
  V value,
  Headers headers,
  Long timestamp,
  Serializer<K> keySerializer,
  Serializer<V> valueSerializer,
  StreamPartitioner<? super K, ? super V> partitioner)

Sends a record to a topic

Used when:

  • RecordCollectorImpl is requested to send a record

  • InMemoryTimeOrderedKeyValueBuffer is requested to flush

  • StoreChangeLogger is requested to logChange

  • SinkNode is requested to process a record

Table 2. RecordCollectors
RecordCollector Description

NO_OP_COLLECTOR

RecordCollectorImpl

Supplier Contract and recordCollector Method

RecordCollector defines a Supplier that is used to access the RecordCollector.

RecordCollector recordCollector()
Note

recordCollector is used when:

results matching ""

    No results matching ""