public class SinkExecutor
extends java.lang.Object
implements java.lang.Runnable, java.lang.AutoCloseable
The thread of SinkExecutor would be blocked to save resources except: 1. New MetricsRecord comes and notify the SinkExecutor to wake up to process it 2. The time interval to invoke flush() is met so SinkExecutor would wake up to invoke flush()
Constructor and Description |
---|
SinkExecutor(java.lang.String executorName,
IMetricsSink metricsSink,
SlaveLooper slaveLooper,
Communicator<MetricsRecord> metricsInSinkQueue,
SinkContext sinkContext)
Construct a SinkExecutor, which is a Runnable
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
Communicator<MetricsRecord> |
getCommunicator() |
void |
run() |
void |
setProperty(java.lang.String key,
java.lang.Object value) |
void |
setPropertyMap(java.util.Map<? extends java.lang.String,java.lang.Object> configMap) |
public SinkExecutor(java.lang.String executorName, IMetricsSink metricsSink, SlaveLooper slaveLooper, Communicator<MetricsRecord> metricsInSinkQueue, SinkContext sinkContext)
executorName
- the name of this executor used as the name of running threadmetricsSink
- the class implementing IMetricsSinkslaveLooper
- the SlaveLoop to bind withmetricsInSinkQueue
- the queue to read MetricsRecord frompublic void setProperty(java.lang.String key, java.lang.Object value)
public void setPropertyMap(java.util.Map<? extends java.lang.String,java.lang.Object> configMap)
public Communicator<MetricsRecord> getCommunicator()
public void close()
close
in interface java.lang.AutoCloseable
public void run()
run
in interface java.lang.Runnable