KafkaSourceOffset

KafkaSourceOffset is a custom Offset for kafka data source.

KafkaSourceOffset is created (directly or indirectly using apply) when:

KafkaSourceOffset takes a collection of Kafka TopicPartitions with offsets to be created.

Partition Offsets — getPartitionOffsets Method

getPartitionOffsets(
  offset: Offset): Map[TopicPartition, Long]

getPartitionOffsets takes KafkaSourceOffset.partitionToOffsets from offset.

If offset is KafkaSourceOffset, getPartitionOffsets takes the partitions and offsets straight from it.

If however offset is SerializedOffset, getPartitionOffsets deserializes the offsets from JSON.

getPartitionOffsets reports an IllegalArgumentException when offset is neither KafkaSourceOffset or SerializedOffset.

Invalid conversion from offset of [class] to KafkaSourceOffset
Note

getPartitionOffsets is used when:

JSON-Encoded Offset — json Method

json: String
Note
json is part of the Offset Contract for a JSON-encoded offset.

json…​FIXME

Creating KafkaSourceOffset Instance — apply Utility Method

apply(
  offsetTuples: (String, Int, Long)*): KafkaSourceOffset (1)
apply(
  offset: SerializedOffset): KafkaSourceOffset
  1. Used in tests only

apply…​FIXME

Note

apply is used when:

results matching ""

    No results matching ""