public abstract class ConnectRecord<R extends ConnectRecord<R>> extends Object
Base class for records containing data to be copied to/from Kafka. This corresponds closely to
Kafka's ProducerRecord
and ConsumerRecord
classes, and holds the data that may be used by both
sources and sinks (topic, kafkaPartition, key, value, timestamp, headers). Although both implementations include a
notion of offset, it is not included here because they differ in type.
Constructor and Description |
---|
ConnectRecord(String topic,
Integer kafkaPartition,
Schema keySchema,
Object key,
Schema valueSchema,
Object value,
Long timestamp) |
ConnectRecord(String topic,
Integer kafkaPartition,
Schema keySchema,
Object key,
Schema valueSchema,
Object value,
Long timestamp,
Iterable<Header> headers) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
hashCode() |
Headers |
headers()
Get the headers for this record.
|
Integer |
kafkaPartition() |
Object |
key() |
Schema |
keySchema() |
abstract R |
newRecord(String topic,
Integer kafkaPartition,
Schema keySchema,
Object key,
Schema valueSchema,
Object value,
Long timestamp)
Create a new record of the same type as itself, with the specified parameter values.
|
abstract R |
newRecord(String topic,
Integer kafkaPartition,
Schema keySchema,
Object key,
Schema valueSchema,
Object value,
Long timestamp,
Iterable<Header> headers)
Create a new record of the same type as itself, with the specified parameter values.
|
Long |
timestamp() |
String |
topic() |
String |
toString() |
Object |
value() |
Schema |
valueSchema() |
public ConnectRecord(String topic, Integer kafkaPartition, Schema keySchema, Object key, Schema valueSchema, Object value, Long timestamp)
public String topic()
public Integer kafkaPartition()
public Object key()
public Schema keySchema()
public Object value()
public Schema valueSchema()
public Long timestamp()
public Headers headers()
public abstract R newRecord(String topic, Integer kafkaPartition, Schema keySchema, Object key, Schema valueSchema, Object value, Long timestamp)
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 abstract R newRecord(String topic, Integer kafkaPartition, Schema keySchema, Object key, Schema valueSchema, Object value, Long timestamp, Iterable<Header> headers)
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 empty