public class RecordMetadata extends Object
Constructor and Description |
---|
RecordMetadata()
Constructor
|
RecordMetadata(JsonObject json)
Constructor (from JSON representation)
|
RecordMetadata(long checksum,
long offset,
int partition,
long timestamp,
String topic)
Constructor
|
Modifier and Type | Method and Description |
---|---|
long |
checksum()
Deprecated.
As of Kafka 0.11.0. Because of the potential for message format conversion on the broker, the
checksum returned by the broker may not match what was computed by the producer.
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.
|
long |
getOffset() |
int |
getPartition() |
long |
getTimestamp() |
String |
getTopic() |
RecordMetadata |
setChecksum(long checksum)
Set the checksum (CRC32) of the record.
|
RecordMetadata |
setOffset(long offset)
Set the offset of the record in the topic/partition.
|
RecordMetadata |
setPartition(int partition)
Set the partition the record was sent to
|
RecordMetadata |
setTimestamp(long timestamp)
Set the timestamp of the record in the topic/partition
|
RecordMetadata |
setTopic(String topic)
Set the topic the record was appended to
|
JsonObject |
toJson()
Convert object to JSON representation
|
public RecordMetadata()
public RecordMetadata(long checksum, long offset, int partition, long timestamp, String topic)
checksum
- checksum (CRC32) of the recordoffset
- the offset of the record in the topic/partition.partition
- the partition the record was sent totimestamp
- the timestamp of the record in the topic/partitiontopic
- the topic the record was appended topublic RecordMetadata(JsonObject json)
json
- JSON representation@Deprecated public long checksum()
public RecordMetadata setChecksum(long checksum)
checksum
- checksum (CRC32) of the recordpublic long getOffset()
public RecordMetadata setOffset(long offset)
offset
- offset of the record in the topic/partitionpublic int getPartition()
public RecordMetadata setPartition(int partition)
partition
- the partition the record was sent topublic long getTimestamp()
public RecordMetadata setTimestamp(long timestamp)
timestamp
- the timestamp of the record in the topic/partitionpublic String getTopic()
public RecordMetadata setTopic(String topic)
topic
- the topic the record was appended topublic JsonObject toJson()
Copyright © 2022 Eclipse. All rights reserved.