public class InfluxDBTemplate<T> extends InfluxDBAccessor implements InfluxDBOperations<T>
logger| Constructor and Description |
|---|
InfluxDBTemplate() |
InfluxDBTemplate(InfluxDBConnectionFactory connectionFactory,
PointCollectionConverter<T> converter) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
void |
createDatabase()
Ensures that the configured database exists.
|
org.influxdb.dto.Pong |
ping()
Ping the database.
|
org.influxdb.dto.QueryResult |
query(org.influxdb.dto.Query query)
Executes a query against the database.
|
void |
query(org.influxdb.dto.Query query,
int chunkSize,
Consumer<org.influxdb.dto.QueryResult> consumer)
Execute a streaming query against the database.
|
org.influxdb.dto.QueryResult |
query(org.influxdb.dto.Query query,
TimeUnit timeUnit)
Executes a query against the database.
|
void |
setConverter(PointCollectionConverter<T> converter) |
String |
version()
Return the version of the connected database.
|
void |
write(List<T> payload)
Write a set of measurements to the database.
|
void |
write(T... payload)
Write a single measurement to the database.
|
getConnection, getConnectionFactory, getDatabase, getRetentionPolicy, setConnectionFactorypublic InfluxDBTemplate()
public InfluxDBTemplate(InfluxDBConnectionFactory connectionFactory, PointCollectionConverter<T> converter)
public void setConverter(PointCollectionConverter<T> converter)
public void afterPropertiesSet()
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanafterPropertiesSet in class InfluxDBAccessorpublic void createDatabase()
InfluxDBOperationscreateDatabase in interface InfluxDBOperations<T>public void write(T... payload)
InfluxDBOperationswrite in interface InfluxDBOperations<T>payload - the measurement to write topublic void write(List<T> payload)
InfluxDBOperationswrite in interface InfluxDBOperations<T>payload - the values to write topublic org.influxdb.dto.QueryResult query(org.influxdb.dto.Query query)
InfluxDBOperationsquery in interface InfluxDBOperations<T>query - the query to executepublic org.influxdb.dto.QueryResult query(org.influxdb.dto.Query query,
TimeUnit timeUnit)
InfluxDBOperationsquery in interface InfluxDBOperations<T>query - the query to executetimeUnit - the time unit to be used for the querypublic void query(org.influxdb.dto.Query query,
int chunkSize,
Consumer<org.influxdb.dto.QueryResult> consumer)
InfluxDBOperationsquery in interface InfluxDBOperations<T>query - the query to executechunkSize - the number of QueryResults to process in one chunkconsumer - the consumer to invoke for each received QueryResultpublic org.influxdb.dto.Pong ping()
InfluxDBOperationsping in interface InfluxDBOperations<T>public String version()
InfluxDBOperationsversion in interface InfluxDBOperations<T>Copyright © 2018 Pivotal Software, Inc.. All rights reserved.