getPartitionOffsets(
offset: Offset): Map[TopicPartition, Long]
KafkaSourceOffset
KafkaSourceOffset
is a custom Offset for kafka data source.
-
KafkaContinuousReader
is requested to setStartOffset, deserializeOffset, and mergeOffsets -
KafkaMicroBatchReader
is requested to getStartOffset, getEndOffset, deserializeOffset, and getOrCreateInitialPartitionOffsets -
KafkaOffsetReader
is requested to fetchSpecificOffsets -
KafkaSource
is requested for the initial partition offsets (of 0th batch) and getOffset -
KafkaSourceInitialOffsetWriter
is requested to deserialize a KafkaSourceOffset (from an InputStream) -
KafkaSourceOffset
is 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
|
|