getPartitionOffsets(
offset: Offset): Map[TopicPartition, Long]
KafkaSourceOffset
KafkaSourceOffset is a custom Offset for kafka data source.
-
KafkaContinuousReaderis requested to setStartOffset, deserializeOffset, and mergeOffsets -
KafkaMicroBatchReaderis requested to getStartOffset, getEndOffset, deserializeOffset, and getOrCreateInitialPartitionOffsets -
KafkaOffsetReaderis requested to fetchSpecificOffsets -
KafkaSourceis requested for the initial partition offsets (of 0th batch) and getOffset -
KafkaSourceInitialOffsetWriteris requested to deserialize a KafkaSourceOffset (from an InputStream) -
KafkaSourceOffsetis requested for partition offsets
Partition Offsets — getPartitionOffsets Method
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
|
|
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
-
Used in tests only
apply…FIXME
|
Note
|
|