public class KafkaWriter extends java.lang.Object implements IRawDataWriter
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CONFIG_PROPERTY_ACKS
The name of the configuration property for the acks parameter.
|
static java.lang.String |
CONFIG_PROPERTY_BATCH_SIZE
The name of the configuration property for the batch size.
|
static java.lang.String |
CONFIG_PROPERTY_BOOTSTRAP_SERVERS
The name of the configuration property for the bootstrap servers.
|
static java.lang.String |
CONFIG_PROPERTY_BUFFER_MEMORY
The name of the configuration property for the buffer memory size.
|
static java.lang.String |
CONFIG_PROPERTY_LINGER_MS
The name of the configuration property for the linger interval.
|
static java.lang.String |
CONFIG_PROPERTY_TOPIC_NAME
The name of the configuration property for the topic name.
|
| Constructor and Description |
|---|
KafkaWriter(Configuration configuration)
Creates a new Kafka writer using the given configuration.
|
| Modifier and Type | Method and Description |
|---|---|
void |
onInitialization()
Called by the collector during initialization (before any records are written).
|
void |
onTermination()
Called by the collector upon termination (after remaining records have been flushed).
|
void |
writeData(java.nio.ByteBuffer buffer,
int offset,
int length)
Writes raw data contained in the given byte buffer.
|
public static final java.lang.String CONFIG_PROPERTY_ACKS
public static final java.lang.String CONFIG_PROPERTY_BATCH_SIZE
public static final java.lang.String CONFIG_PROPERTY_BOOTSTRAP_SERVERS
public static final java.lang.String CONFIG_PROPERTY_BUFFER_MEMORY
public static final java.lang.String CONFIG_PROPERTY_LINGER_MS
public static final java.lang.String CONFIG_PROPERTY_TOPIC_NAME
public KafkaWriter(Configuration configuration)
configuration - The configuration to usepublic void onInitialization()
IRawDataWriteronInitialization in interface IRawDataWriterpublic void onTermination()
IRawDataWriteronTermination in interface IRawDataWriterpublic void writeData(java.nio.ByteBuffer buffer,
int offset,
int length)
IRawDataWriterwriteData in interface IRawDataWriterbuffer - The buffer containing the dataoffset - The offset in the buffer where the data startslength - The length of the data to writeCopyright 2017 Kieker Project, http://kieker-monitoring.net