Package org.apache.kafka.clients.admin
Class OffsetSpec
java.lang.Object
org.apache.kafka.clients.admin.OffsetSpec
- Direct Known Subclasses:
OffsetSpec.EarliestSpec
,OffsetSpec.LatestSpec
,OffsetSpec.MaxTimestampSpec
,OffsetSpec.TimestampSpec
public class OffsetSpec extends Object
This class allows to specify the desired offsets when using
KafkaAdminClient.listOffsets(Map, ListOffsetsOptions)
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OffsetSpec.EarliestSpec
static class
OffsetSpec.LatestSpec
static class
OffsetSpec.MaxTimestampSpec
static class
OffsetSpec.TimestampSpec
-
Constructor Summary
Constructors Constructor Description OffsetSpec()
-
Method Summary
Modifier and Type Method Description static OffsetSpec
earliest()
Used to retrieve the earliest offset of a partitionstatic OffsetSpec
forTimestamp(long timestamp)
Used to retrieve the earliest offset whose timestamp is greater than or equal to the given timestamp in the corresponding partitionstatic OffsetSpec
latest()
Used to retrieve the latest offset of a partitionstatic OffsetSpec
maxTimestamp()
Used to retrieve the offset with the largest timestamp of a partition as message timestamps can be specified client side this may not match the log end offset returned by LatestSpec
-
Constructor Details
-
OffsetSpec
public OffsetSpec()
-
-
Method Details
-
latest
Used to retrieve the latest offset of a partition -
earliest
Used to retrieve the earliest offset of a partition -
forTimestamp
Used to retrieve the earliest offset whose timestamp is greater than or equal to the given timestamp in the corresponding partition- Parameters:
timestamp
- in milliseconds
-
maxTimestamp
Used to retrieve the offset with the largest timestamp of a partition as message timestamps can be specified client side this may not match the log end offset returned by LatestSpec
-