public final class RecordMetadata extends Object
Modifier and Type | Field and Description |
---|---|
static int |
UNKNOWN_PARTITION
Partition value for record without partition assigned
|
Constructor and Description |
---|
RecordMetadata(TopicPartition topicPartition,
long baseOffset,
int batchIndex,
long timestamp,
int serializedKeySize,
int serializedValueSize)
Creates a new instance with the provided parameters.
|
RecordMetadata(TopicPartition topicPartition,
long baseOffset,
long batchIndex,
long timestamp,
Long checksum,
int serializedKeySize,
int serializedValueSize)
Deprecated.
use constructor without `checksum` parameter. This constructor will be removed in
Apache Kafka 4.0 (deprecated since 3.0).
|
Modifier and Type | Method and Description |
---|---|
boolean |
hasOffset()
Indicates whether the record metadata includes the offset.
|
boolean |
hasTimestamp()
Indicates whether the record metadata includes the timestamp.
|
long |
offset()
The offset of the record in the topic/partition.
|
int |
partition()
The partition the record was sent to
|
int |
serializedKeySize()
The size of the serialized, uncompressed key in bytes.
|
int |
serializedValueSize()
The size of the serialized, uncompressed value in bytes.
|
long |
timestamp()
The timestamp of the record in the topic/partition.
|
String |
topic()
The topic the record was appended to
|
String |
toString() |
public static final int UNKNOWN_PARTITION
public RecordMetadata(TopicPartition topicPartition, long baseOffset, int batchIndex, long timestamp, int serializedKeySize, int serializedValueSize)
@Deprecated public RecordMetadata(TopicPartition topicPartition, long baseOffset, long batchIndex, long timestamp, Long checksum, int serializedKeySize, int serializedValueSize)
public boolean hasOffset()
public long offset()
hasOffset()
} returns false.public boolean hasTimestamp()
public long timestamp()
hasTimestamp()
} returns false.public int serializedKeySize()
public int serializedValueSize()
public String topic()
public int partition()