public class MigratoryDataKafkaUtils extends Object
| Constructor and Description |
|---|
MigratoryDataKafkaUtils() |
| Modifier and Type | Method and Description |
|---|---|
static org.apache.kafka.common.header.Headers |
addRecordMetadata(org.apache.kafka.common.header.Headers headers,
boolean compression,
MigratoryDataMessage.QoS qos,
boolean retained)
Add metadata to a Kafka record
|
static org.apache.kafka.common.header.Headers |
addRecordMetadata(org.apache.kafka.common.header.Headers headers,
boolean compression,
MigratoryDataMessage.QoS qos,
boolean retained,
boolean benchmarkTimestamp)
Add metadata to a Kafka record
|
static byte[] |
compressValue(byte[] data)
Compress the value of a Kafka record
|
static org.apache.kafka.clients.producer.ProducerRecord<String,byte[]> |
createRecord(String topic,
int partition,
long timestamp,
String key,
byte[] value,
boolean compression,
MigratoryDataMessage.QoS qos,
boolean retained)
Creates a Kafka record with a specified timestamp to be sent to a specified topic and partition, with customizable quality of service, compression, and retention options for MigratoryData
|
static org.apache.kafka.clients.producer.ProducerRecord<String,byte[]> |
createRecord(String topic,
int partition,
String key,
byte[] value,
boolean compression,
MigratoryDataMessage.QoS qos,
boolean retained)
Creates a Kafka record to be sent to a specified topic and partition, with customizable quality of service, compression, and retention options for MigratoryData
|
static org.apache.kafka.clients.producer.ProducerRecord<String,byte[]> |
createRecord(String topic,
String key,
byte[] value,
boolean compression,
MigratoryDataMessage.QoS qos,
boolean retained)
Creates a Kafka record to be sent to a specified topic, with customizable quality of service, compression, and retention options for MigratoryData
|
static org.apache.kafka.clients.producer.ProducerRecord<String,byte[]> |
createRecord(String topic,
String key,
byte[] value,
boolean compression,
MigratoryDataMessage.QoS qos,
boolean retained,
boolean benchmarkTimestamp)
Creates a Kafka record to be sent to a specified topic, with customizable quality of service, compression, and retention options for MigratoryData
|
static byte[] |
decompressValue(byte[] data)
Decompress the value of a Kafka record compressed with the compress method
|
static byte[] |
getRecordValue(org.apache.kafka.clients.consumer.ConsumerRecord<String,byte[]> record)
Get the content of a Kafka record corresponding to a MigratoryData message
|
public static org.apache.kafka.clients.producer.ProducerRecord<String,byte[]> createRecord(String topic, String key, byte[] value, boolean compression, MigratoryDataMessage.QoS qos, boolean retained)
topic - The topic the record will be appended tokey - The key that will be included in the recordvalue - The record contentcompression - Specify whether to compress the record contentqos - Define the quality of service (QoS) for delivery by MigratoryData; either QoS.STANDARD or QoS.GUARANTEEDretained - Specify if this record should be retained by MigratoryData as a snapshot messagepublic static org.apache.kafka.clients.producer.ProducerRecord<String,byte[]> createRecord(String topic, int partition, String key, byte[] value, boolean compression, MigratoryDataMessage.QoS qos, boolean retained)
topic - The topic the record will be appended topartition - The partition to which the record should be sentkey - The key that will be included in the recordvalue - The record contentcompression - Specify whether to compress the record contentqos - Define the quality of service (QoS) for delivery by MigratoryData; either QoS.STANDARD or QoS.GUARANTEEDretained - Specify if this record should be retained by MigratoryData as a snapshot messagepublic static org.apache.kafka.clients.producer.ProducerRecord<String,byte[]> createRecord(String topic, int partition, long timestamp, String key, byte[] value, boolean compression, MigratoryDataMessage.QoS qos, boolean retained)
topic - The topic the record will be appended topartition - The partition to which the record should be senttimestamp - The timestamp of the record, in milliseconds since epoch. If null, the producer will assign the timestamp using System.currentTimeMillis().key - The key that will be included in the recordvalue - The record contentcompression - Specify whether to compress the record contentqos - Define the quality of service (QoS) for delivery by MigratoryData; either QoS.STANDARD or QoS.GUARANTEEDretained - Specify if this record should be retained by MigratoryData as a snapshot messagepublic static org.apache.kafka.clients.producer.ProducerRecord<String,byte[]> createRecord(String topic, String key, byte[] value, boolean compression, MigratoryDataMessage.QoS qos, boolean retained, boolean benchmarkTimestamp)
topic - The topic the record will be appended tokey - The key that will be included in the recordvalue - The record contentcompression - Specify whether to compress the record contentqos - Define the quality of service (QoS) for delivery by MigratoryData; either QoS.STANDARD or QoS.GUARANTEEDretained - Specify if this record should be retained by MigratoryData as a snapshot messagebenchmarkTimestamp - Specify if the record should include a timestamp for benchmarking purposespublic static byte[] getRecordValue(org.apache.kafka.clients.consumer.ConsumerRecord<String,byte[]> record)
record - A Kafka recordpublic static byte[] compressValue(byte[] data)
data - The data to be compressedpublic static byte[] decompressValue(byte[] data)
data - The compressed datapublic static org.apache.kafka.common.header.Headers addRecordMetadata(org.apache.kafka.common.header.Headers headers,
boolean compression,
MigratoryDataMessage.QoS qos,
boolean retained)
headers - The headers of the Kafka recordcompression - Specify whether to compress the record contentqos - Define the quality of service (QoS) for delivery by MigratoryData; either QoS.STANDARD or QoS.GUARANTEEDretained - Specify if this record should be retained by MigratoryData as a snapshot messagepublic static org.apache.kafka.common.header.Headers addRecordMetadata(org.apache.kafka.common.header.Headers headers,
boolean compression,
MigratoryDataMessage.QoS qos,
boolean retained,
boolean benchmarkTimestamp)
headers - The headers of the Kafka recordcompression - Specify whether to compress the record contentqos - Define the quality of service (QoS) for delivery by MigratoryData; either QoS.STANDARD or QoS.GUARANTEEDretained - Specify if this record should be retained by MigratoryData as a snapshot messagebenchmarkTimestamp - Specify if the record should include a timestamp for benchmarking purposesCopyright © 2024. All rights reserved.