public class KafkaMetricsCollectionService extends AggregatedMetricsCollectionService
AggregatedMetricsCollectionService that publish MetricValues to kafka.
The partition is determined by the metric context.| Constructor and Description |
|---|
KafkaMetricsCollectionService(KafkaClient kafkaClient,
String topicPrefix,
DatumWriter<MetricValues> recordWriter) |
KafkaMetricsCollectionService(KafkaClient kafkaClient,
String topicPrefix,
KafkaPublisher.Ack ack,
DatumWriter<MetricValues> recordWriter) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
publish(Iterator<MetricValues> metrics)
Publishes the given collection of
MetricValues. |
protected void |
startUp() |
executor, getContext, runOneIteration, scheduler, shutDownaddListener, isRunning, start, startAndWait, state, stop, stopAndWait, toString@Inject public KafkaMetricsCollectionService(KafkaClient kafkaClient, String topicPrefix, DatumWriter<MetricValues> recordWriter)
public KafkaMetricsCollectionService(KafkaClient kafkaClient, String topicPrefix, KafkaPublisher.Ack ack, DatumWriter<MetricValues> recordWriter)
protected void startUp()
throws Exception
startUp in class com.google.common.util.concurrent.AbstractScheduledServiceExceptionprotected void publish(Iterator<MetricValues> metrics) throws Exception
AggregatedMetricsCollectionServiceMetricValues. When this method returns, the
given Iterator will no longer be valid. This method should process the input
iterator and returns quickly. Any long operations should be run in a separated thread.
This method is guaranteed not to get concurrent calls.publish in class AggregatedMetricsCollectionServicemetrics - collection of MetricValues to publish.Exception - if there is error raised during publish.Copyright © 2015 Cask Data, Inc. Licensed under the Apache License, Version 2.0.