net.opentsdb.tsd
public abstract class RTPublisher extends Object
Note: Implementations must have a parameterless constructor. The
initialize(TSDB)
method will be called immediately after the plugin is
instantiated and before any other methods are called.
Warning: All processing should be performed asynchronously and return a Deferred as quickly as possible.
Constructor and Description |
---|
RTPublisher() |
Modifier and Type | Method and Description |
---|---|
abstract void |
collectStats(StatsCollector collector)
Called by the TSD when a request for statistics collection has come in.
|
abstract void |
initialize(TSDB tsdb)
Called by TSDB to initialize the plugin
Implementations are responsible for setting up any IO they need as well
as starting any required background threads.
|
abstract com.stumbleupon.async.Deferred<Object> |
publishAnnotation(Annotation annotation)
Called any time a new annotation is published
|
abstract com.stumbleupon.async.Deferred<Object> |
publishDataPoint(String metric,
long timestamp,
double value,
Map<String,String> tags,
byte[] tsuid)
Called any time a new data point is published
|
abstract com.stumbleupon.async.Deferred<Object> |
publishDataPoint(String metric,
long timestamp,
long value,
Map<String,String> tags,
byte[] tsuid)
Called any time a new data point is published
|
abstract com.stumbleupon.async.Deferred<Object> |
shutdown()
Called to gracefully shutdown the plugin.
|
com.stumbleupon.async.Deferred<Object> |
sinkDataPoint(String metric,
long timestamp,
byte[] value,
Map<String,String> tags,
byte[] tsuid,
short flags)
Called by the TSD when a new, raw data point is published.
|
abstract String |
version()
Should return the version of this plugin in the format:
MAJOR.MINOR.MAINT, e.g.
|
public abstract void initialize(TSDB tsdb)
tsdb
- The parent TSDB objectIllegalArgumentException
- if required configuration parameters are
missingException
- if something else goes wrongpublic abstract com.stumbleupon.async.Deferred<Object> shutdown()
Object
has not special meaning and can be null
(think of it as Deferred<Void>
).public abstract String version()
public abstract void collectStats(StatsCollector collector)
collector
- The collector used for emitting statisticspublic final com.stumbleupon.async.Deferred<Object> sinkDataPoint(String metric, long timestamp, byte[] value, Map<String,String> tags, byte[] tsuid, short flags)
metric
- The name of the metric associated with the data pointtimestamp
- Timestamp as a Unix epoch in seconds or milliseconds
(depending on the TSD's configuration)value
- The value as a byte arraytags
- Tagk/v pairstsuid
- Time series UID for the valueflags
- Indicates if the byte array is an integer or floating point
valuepublic abstract com.stumbleupon.async.Deferred<Object> publishDataPoint(String metric, long timestamp, long value, Map<String,String> tags, byte[] tsuid)
metric
- The name of the metric associated with the data pointtimestamp
- Timestamp as a Unix epoch in seconds or milliseconds
(depending on the TSD's configuration)value
- Value for the data pointtags
- Tagk/v pairstsuid
- Time series UID for the valuepublic abstract com.stumbleupon.async.Deferred<Object> publishDataPoint(String metric, long timestamp, double value, Map<String,String> tags, byte[] tsuid)
metric
- The name of the metric associated with the data pointtimestamp
- Timestamp as a Unix epoch in seconds or milliseconds
(depending on the TSD's configuration)value
- Value for the data pointtags
- Tagk/v pairstsuid
- Time series UID for the valuepublic abstract com.stumbleupon.async.Deferred<Object> publishAnnotation(Annotation annotation)
annotation
- The published annotation