public class SinkRecord extends ConnectRecord<SinkRecord>
ConnectRecord
that has been read from Kafka and includes the kafkaOffset of
the record in the Kafka topic-partition in addition to the standard fields. This information
should be used by the SinkTask to coordinate kafkaOffset commits.
It also includes the TimestampType
, which may be TimestampType.NO_TIMESTAMP_TYPE
, and the relevant
timestamp, which may be null
.Constructor and Description |
---|
SinkRecord(java.lang.String topic,
int partition,
Schema keySchema,
java.lang.Object key,
Schema valueSchema,
java.lang.Object value,
long kafkaOffset) |
SinkRecord(java.lang.String topic,
int partition,
Schema keySchema,
java.lang.Object key,
Schema valueSchema,
java.lang.Object value,
long kafkaOffset,
java.lang.Long timestamp,
org.apache.kafka.common.record.TimestampType timestampType) |
SinkRecord(java.lang.String topic,
int partition,
Schema keySchema,
java.lang.Object key,
Schema valueSchema,
java.lang.Object value,
long kafkaOffset,
java.lang.Long timestamp,
org.apache.kafka.common.record.TimestampType timestampType,
java.lang.Iterable<Header> headers) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
long |
kafkaOffset() |
SinkRecord |
newRecord(java.lang.String topic,
java.lang.Integer kafkaPartition,
Schema keySchema,
java.lang.Object key,
Schema valueSchema,
java.lang.Object value,
java.lang.Long timestamp)
Create a new record of the same type as itself, with the specified parameter values.
|
SinkRecord |
newRecord(java.lang.String topic,
java.lang.Integer kafkaPartition,
Schema keySchema,
java.lang.Object key,
Schema valueSchema,
java.lang.Object value,
java.lang.Long timestamp,
java.lang.Iterable<Header> headers)
Create a new record of the same type as itself, with the specified parameter values.
|
org.apache.kafka.common.record.TimestampType |
timestampType() |
java.lang.String |
toString() |
headers, kafkaPartition, key, keySchema, timestamp, topic, value, valueSchema
public SinkRecord(java.lang.String topic, int partition, Schema keySchema, java.lang.Object key, Schema valueSchema, java.lang.Object value, long kafkaOffset)
public SinkRecord(java.lang.String topic, int partition, Schema keySchema, java.lang.Object key, Schema valueSchema, java.lang.Object value, long kafkaOffset, java.lang.Long timestamp, org.apache.kafka.common.record.TimestampType timestampType)
public long kafkaOffset()
public org.apache.kafka.common.record.TimestampType timestampType()
public SinkRecord newRecord(java.lang.String topic, java.lang.Integer kafkaPartition, Schema keySchema, java.lang.Object key, Schema valueSchema, java.lang.Object value, java.lang.Long timestamp)
ConnectRecord
newRecord
in class ConnectRecord<SinkRecord>
topic
- the name of the topic; may be nullkafkaPartition
- the partition number for the Kafka topic; may be nullkeySchema
- the schema for the key; may be nullkey
- the key; may be nullvalueSchema
- the schema for the value; may be nullvalue
- the value; may be nulltimestamp
- the timestamp; may be nullpublic SinkRecord newRecord(java.lang.String topic, java.lang.Integer kafkaPartition, Schema keySchema, java.lang.Object key, Schema valueSchema, java.lang.Object value, java.lang.Long timestamp, java.lang.Iterable<Header> headers)
ConnectRecord
newRecord
in class ConnectRecord<SinkRecord>
topic
- the name of the topic; may be nullkafkaPartition
- the partition number for the Kafka topic; may be nullkeySchema
- the schema for the key; may be nullkey
- the key; may be nullvalueSchema
- the schema for the value; may be nullvalue
- the value; may be nulltimestamp
- the timestamp; may be nullheaders
- the headers; may be null or emptypublic boolean equals(java.lang.Object o)
equals
in class ConnectRecord<SinkRecord>
public int hashCode()
hashCode
in class ConnectRecord<SinkRecord>
public java.lang.String toString()
toString
in class ConnectRecord<SinkRecord>