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.TimestampSpec
public class OffsetSpec extends java.lang.ObjectThis class allows to specify the desired offsets when usingKafkaAdminClient.listOffsets(Map, ListOffsetsOptions)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOffsetSpec.EarliestSpecstatic classOffsetSpec.LatestSpecstatic classOffsetSpec.TimestampSpec
-
Constructor Summary
Constructors Constructor Description OffsetSpec()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static OffsetSpecearliest()Used to retrieve the earliest offset of a partitionstatic OffsetSpecforTimestamp(long timestamp)Used to retrieve the earliest offset whose timestamp is greater than or equal to the given timestamp in the corresponding partitionstatic OffsetSpeclatest()Used to retrieve the latest offset of a partition
-
-
-
Method Detail
-
latest
public static OffsetSpec latest()
Used to retrieve the latest offset of a partition
-
earliest
public static OffsetSpec earliest()
Used to retrieve the earliest offset of a partition
-
forTimestamp
public static OffsetSpec forTimestamp(long timestamp)
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
-
-