public final class RecordMetadata
extends java.lang.Object
Modifier and Type | Field | Description |
---|---|---|
static int |
UNKNOWN_PARTITION |
Partition value for record without partition assigned
|
Constructor | Description |
---|---|
RecordMetadata(TopicPartition topicPartition,
long baseOffset,
long relativeOffset,
long timestamp,
java.lang.Long checksum,
int serializedKeySize,
int serializedValueSize) |
Modifier and Type | Method | Description |
---|---|---|
long |
checksum() |
Deprecated.
As of Kafka 0.11.0. Because of the potential for message format conversion on the broker, the
computed checksum may not match what was stored on the broker, or what will be returned to the consumer.
It is therefore unsafe to depend on this checksum for end-to-end delivery guarantees. Additionally,
message format v2 does not include a record-level checksum (for performance, the record checksum
was replaced with a batch checksum). To maintain compatibility, a partial checksum computed from
the record timestamp, serialized key size, and serialized value size is returned instead, but
this should not be depended on for end-to-end reliability.
|
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.
|
java.lang.String |
topic() |
The topic the record was appended to
|
java.lang.String |
toString() |
public static final int UNKNOWN_PARTITION
public RecordMetadata(TopicPartition topicPartition, long baseOffset, long relativeOffset, long timestamp, java.lang.Long checksum, int serializedKeySize, int serializedValueSize)
public boolean hasOffset()
public long offset()
hasOffset()
} returns false.public boolean hasTimestamp()
public long timestamp()
hasTimestamp()
} returns false.@Deprecated public long checksum()
public int serializedKeySize()
public int serializedValueSize()
public java.lang.String topic()
public int partition()
public java.lang.String toString()
toString
in class java.lang.Object