public class OffsetAndMetadata extends Object implements Serializable
Constructor and Description |
---|
OffsetAndMetadata(long offset)
Construct a new OffsetAndMetadata object for committing through
KafkaConsumer . |
OffsetAndMetadata(long offset,
Optional<Integer> leaderEpoch,
String metadata)
Construct a new OffsetAndMetadata object for committing through
KafkaConsumer . |
OffsetAndMetadata(long offset,
String metadata)
Construct a new OffsetAndMetadata object for committing through
KafkaConsumer . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
hashCode() |
Optional<Integer> |
leaderEpoch()
Get the leader epoch of the previously consumed record (if one is known).
|
String |
metadata() |
long |
offset() |
String |
toString() |
public OffsetAndMetadata(long offset, Optional<Integer> leaderEpoch, String metadata)
KafkaConsumer
.offset
- The offset to be committedleaderEpoch
- Optional leader epoch of the last consumed recordmetadata
- Non-null metadatapublic OffsetAndMetadata(long offset, String metadata)
KafkaConsumer
.offset
- The offset to be committedmetadata
- Non-null metadatapublic OffsetAndMetadata(long offset)
KafkaConsumer
. The metadata
associated with the commit will be empty.offset
- The offset to be committedpublic long offset()
public String metadata()
public Optional<Integer> leaderEpoch()