KafkaOffsetRangeLimit — Desired Offset Range Limits¶
KafkaOffsetRangeLimit represents the desired offset range limits for starting, ending, and specific offsets in Kafka Data Source.
[[implementations]] .KafkaOffsetRangeLimits [cols="1m,3",options="header",width="100%"] |=== | KafkaOffsetRangeLimit | Description
| EarliestOffsetRangeLimit | [[EarliestOffsetRangeLimit]] Intent to bind to the earliest offset
| LatestOffsetRangeLimit | [[LatestOffsetRangeLimit]] Intent to bind to the latest offset
| SpecificOffsetRangeLimit a| [[SpecificOffsetRangeLimit]] Intent to bind to specific offsets with the following special offset "magic" numbers:
- [[LATEST]]
-1orKafkaOffsetRangeLimit.LATEST- the latest offset - [[EARLIEST]]
-2orKafkaOffsetRangeLimit.EARLIEST- the earliest offset
|===
NOTE: KafkaOffsetRangeLimit is a Scala sealed trait which means that all the <
KafkaOffsetRangeLimit is often used in a text-based representation and is converted to from latest, earliest or a JSON-formatted text using KafkaSourceProvider.getKafkaOffsetRangeLimit utility.
NOTE: A JSON-formatted text is of the following format {"topicName":{"partition":offset},...}, e.g. {"topicA":{"0":23,"1":-1},"topicB":{"0":-2}}.
KafkaOffsetRangeLimit is used when:
-
KafkaRelation is created (with the starting and ending offsets)
-
KafkaSource is created (with the starting offsets)
-
KafkaSourceProvideris requested to convert configuration options to KafkaOffsetRangeLimits