public interface InfluxDB
Modifier and Type | Interface and Description |
---|---|
static class |
InfluxDB.ConsistencyLevel
ConsistencyLevel for write Operations.
|
static class |
InfluxDB.LogLevel
Controls the level of logging of the REST layer.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
close thread for asynchronous batch write and UDP socket to release resources if need.
|
void |
createDatabase(String name)
Create a new Database.
|
boolean |
databaseExists(String name)
Check if a database exists.
|
void |
deleteDatabase(String name)
Delete a database.
|
List<String> |
describeDatabases()
Describe all available databases.
|
void |
disableBatch()
Disable Batching.
|
InfluxDB |
disableGzip()
Disable Gzip compress for http request body.
|
InfluxDB |
enableBatch(int actions,
int flushDuration,
TimeUnit flushDurationTimeUnit)
Enable batching of single Point writes as
enableBatch(int, int, TimeUnit, ThreadFactory) }
using default thread factory. |
InfluxDB |
enableBatch(int actions,
int flushDuration,
TimeUnit flushDurationTimeUnit,
ThreadFactory threadFactory)
Enable batching of single Point writes as
enableBatch(int, int, TimeUnit, ThreadFactory, BiConsumer)
using with a exceptionHandler that does nothing. |
InfluxDB |
enableBatch(int actions,
int flushDuration,
TimeUnit flushDurationTimeUnit,
ThreadFactory threadFactory,
BiConsumer<Iterable<Point>,Throwable> exceptionHandler)
Enable batching of single Point writes to speed up writes significant.
|
InfluxDB |
enableGzip()
Enable Gzip compress for http request body.
|
void |
flush()
Send any buffered points to InfluxDB.
|
boolean |
isBatchEnabled()
Returns whether Batching is enabled.
|
boolean |
isGzipEnabled()
Returns whether Gzip compress for http request body is enabled.
|
Pong |
ping()
Ping this influxDB.
|
QueryResult |
query(Query query)
Execute a query against a database.
|
void |
query(Query query,
int chunkSize,
Consumer<QueryResult> consumer)
Execute a streaming query against a database.
|
QueryResult |
query(Query query,
TimeUnit timeUnit)
Execute a query against a database.
|
InfluxDB |
setConsistency(InfluxDB.ConsistencyLevel consistency)
Set the consistency level which is used for writing points.
|
InfluxDB |
setDatabase(String database)
Set the database which is used for writing points.
|
InfluxDB |
setLogLevel(InfluxDB.LogLevel logLevel)
Set the loglevel which is used for REST related actions.
|
InfluxDB |
setRetentionPolicy(String retentionPolicy)
Set the retention policy which is used for writing points.
|
String |
version()
Return the version of the connected influxDB Server.
|
void |
write(BatchPoints batchPoints)
Write a set of Points to the influxdb database with the new (>= 0.9.0rc32) lineprotocol.
|
void |
write(int udpPort,
List<String> records)
Write a set of Points to the influxdb database with the list of string records through UDP.
|
void |
write(int udpPort,
Point point)
Write a single Point to the database through UDP.
|
void |
write(int udpPort,
String records)
Write a set of Points to the influxdb database with the string records through UDP.
|
void |
write(List<String> records)
Write a set of Points to the default database with the list of string records.
|
void |
write(Point point)
Write a single Point to the default database.
|
void |
write(String records)
Write a set of Points to the default database with the string records.
|
void |
write(String database,
String retentionPolicy,
InfluxDB.ConsistencyLevel consistency,
List<String> records)
Write a set of Points to the influxdb database with the list of string records.
|
void |
write(String database,
String retentionPolicy,
InfluxDB.ConsistencyLevel consistency,
String records)
Write a set of Points to the influxdb database with the string records.
|
void |
write(String database,
String retentionPolicy,
Point point)
Write a single Point to the database.
|
InfluxDB setLogLevel(InfluxDB.LogLevel logLevel)
logLevel
- the loglevel to set.InfluxDB enableGzip()
InfluxDB disableGzip()
boolean isGzipEnabled()
InfluxDB enableBatch(int actions, int flushDuration, TimeUnit flushDurationTimeUnit)
enableBatch(int, int, TimeUnit, ThreadFactory)
}
using default thread factory.actions
- the number of actions to collectflushDuration
- the time to wait at most.flushDurationTimeUnit
- the TimeUnit for the given flushDuration.enableBatch(int, int, TimeUnit, ThreadFactory)
InfluxDB enableBatch(int actions, int flushDuration, TimeUnit flushDurationTimeUnit, ThreadFactory threadFactory)
enableBatch(int, int, TimeUnit, ThreadFactory, BiConsumer)
using with a exceptionHandler that does nothing.actions
- the number of actions to collectflushDuration
- the time to wait at most.flushDurationTimeUnit
- the TimeUnit for the given flushDuration.threadFactory
- a ThreadFactory instance to be used.enableBatch(int, int, TimeUnit, ThreadFactory, BiConsumer)
InfluxDB enableBatch(int actions, int flushDuration, TimeUnit flushDurationTimeUnit, ThreadFactory threadFactory, BiConsumer<Iterable<Point>,Throwable> exceptionHandler)
actions
- the number of actions to collectflushDuration
- the time to wait at most.flushDurationTimeUnit
- the TimeUnit for the given flushDuration.threadFactory
- a ThreadFactory instance to be used.exceptionHandler
- a consumer function to handle asynchronous errorsvoid disableBatch()
boolean isBatchEnabled()
Pong ping()
String version()
void write(Point point)
point
- The point to writevoid write(String records)
records
- the points in the correct lineprotocol.void write(List<String> records)
records
- the List of points in the correct lineprotocol.void write(String database, String retentionPolicy, Point point)
database
- the database to write to.retentionPolicy
- the retentionPolicy to use.point
- The point to writevoid write(int udpPort, Point point)
udpPort
- the udpPort to write to.point
- The point to write.void write(BatchPoints batchPoints)
batchPoints
- the points to write in BatchPoints.void write(String database, String retentionPolicy, InfluxDB.ConsistencyLevel consistency, String records)
database
- the name of the database to writeretentionPolicy
- the retentionPolicy to useconsistency
- the ConsistencyLevel to userecords
- the points in the correct lineprotocol.void write(String database, String retentionPolicy, InfluxDB.ConsistencyLevel consistency, List<String> records)
database
- the name of the database to writeretentionPolicy
- the retentionPolicy to useconsistency
- the ConsistencyLevel to userecords
- the List of points in the correct lineprotocol.void write(int udpPort, String records)
udpPort
- the udpPort where influxdb is listeningrecords
- the content will be encoded by UTF-8 before sent.void write(int udpPort, List<String> records)
udpPort
- the udpPort where influxdb is listeningrecords
- list of record, the content will be encoded by UTF-8 before sent.QueryResult query(Query query)
query
- the query to execute.void query(Query query, int chunkSize, Consumer<QueryResult> consumer)
query
- the query to execute.chunkSize
- the number of QueryResults to process in one chunk.consumer
- the consumer to invoke for each received QueryResultQueryResult query(Query query, TimeUnit timeUnit)
query
- the query to execute.timeUnit
- the time unit of the results.void createDatabase(String name)
name
- the name of the new database.void deleteDatabase(String name)
name
- the name of the database to delete.List<String> describeDatabases()
boolean databaseExists(String name)
name
- the name of the database to search.void flush()
IllegalStateException
- if batching is not enabled.void close()
InfluxDB setConsistency(InfluxDB.ConsistencyLevel consistency)
consistency
- the consistency level to set.InfluxDB setDatabase(String database)
database
- the database to set.Copyright © 2017. All rights reserved.