Package com.influxdb.client.osgi
Class LineProtocolWriter
java.lang.Object
com.influxdb.client.osgi.LineProtocolWriter
- All Implemented Interfaces:
org.osgi.service.event.EventHandler
OSGi event handler writing InfluxDB line protocol records.
Service is used to write RAW (line protocol) event data to InfluxDB. OSGi event topic
DEFAULT_EVENT_TOPIC
used by default. The following OSGi event properties are
supported:
- record (
String
): value must be a single line protocol record - records (
List
): value must be a list of line protocol records - precision (
String
, optional): write precision, values:s
,ms
,us
,ns
, default:ns
- organization (
String
, optional): used to override InfluxDB organization ofLineProtocolWriter
service (by event). - bucket (
String
, optional): used to override InfluxDB bucket ofLineProtocolWriter
service (by event).
One of record or records must be set.
Timestamp is appended to the line protocol record if it is enabled by configuration option (in that case records
must not contain timestamp data!). Value is read from OSGi event (property EventConstants.TIMESTAMP
) or
System.currentTimeMillis()
is set if property not found.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic @interface
Configuration for Line Protocol Writer. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
OSGi event property name to override InfluxDB bucket.static final String
Default OSGi event topic.static final String
OSGi event property name to override InfluxDB organization.static final String
OSGi event property name to set precision.static final String
OSGi event property name used to write single line protocol record.static final String
OSGi event property name used to write list of line protocol records. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
handleEvent
(org.osgi.service.event.Event event) Write line protocol record from OSGi event.
-
Field Details
-
DEFAULT_EVENT_TOPIC
Default OSGi event topic.- See Also:
-
RECORD
OSGi event property name used to write single line protocol record.- See Also:
-
RECORDS
OSGi event property name used to write list of line protocol records.- See Also:
-
PRECISION
OSGi event property name to set precision.- See Also:
-
ORGANIZATION
OSGi event property name to override InfluxDB organization.- See Also:
-
BUCKET
OSGi event property name to override InfluxDB bucket.- See Also:
-
-
Constructor Details
-
LineProtocolWriter
public LineProtocolWriter()
-
-
Method Details
-
handleEvent
public void handleEvent(org.osgi.service.event.Event event) Write line protocol record from OSGi event.- Specified by:
handleEvent
in interfaceorg.osgi.service.event.EventHandler
- Parameters:
event
- OSGI event containing data
-