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 ofLineProtocolWriterservice (by event). - bucket (
String, optional): used to override InfluxDB bucket ofLineProtocolWriterservice (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
Nested ClassesModifier and TypeClassDescriptionstatic @interfaceConfiguration for Line Protocol Writer. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringOSGi event property name to override InfluxDB bucket.static final StringDefault OSGi event topic.static final StringOSGi event property name to override InfluxDB organization.static final StringOSGi event property name to set precision.static final StringOSGi event property name used to write single line protocol record.static final StringOSGi event property name used to write list of line protocol records. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidhandleEvent(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:
handleEventin interfaceorg.osgi.service.event.EventHandler- Parameters:
event- OSGI event containing data
-