@InterfaceAudience.Public @InterfaceStability.Evolving public class KafkaSink extends Object implements MetricsSink, Closeable
Modifier and Type | Field and Description |
---|---|
static String |
BROKER_LIST |
static String |
TOPIC |
Constructor and Description |
---|
KafkaSink() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush()
Flush any buffered metrics
|
void |
init(org.apache.commons.configuration2.SubsetConfiguration conf)
Initialize the plugin
|
void |
putMetrics(MetricsRecord record)
Put a metrics record in the sink
|
void |
setProducer(org.apache.kafka.clients.producer.Producer<Integer,byte[]> p) |
public static final String BROKER_LIST
public static final String TOPIC
public void setProducer(org.apache.kafka.clients.producer.Producer<Integer,byte[]> p)
public void init(org.apache.commons.configuration2.SubsetConfiguration conf)
MetricsPlugin
init
in interface MetricsPlugin
conf
- the configuration object for the pluginpublic void putMetrics(MetricsRecord record)
MetricsSink
putMetrics
in interface MetricsSink
record
- the record to putpublic void flush()
MetricsSink
flush
in interface MetricsSink
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2020 Apache Software Foundation. All rights reserved.