You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

一、已完成

1. write()

write函数有很多接口,主要的适配目标包括:以Point的形式,以String字符串的形式将数据写入数据库中。

已经实现的接口有:


/**
* Write a single Point to the default database.
*/
public void write(final Point point);

/**
* Write a set of Points to the default database with the string records.
*/
public void write(final String records);

/**
* Write a set of Points to the default database with the list of string records.]]
*/
public void write(final List<String> records);

/**
* Write a single Point to the database.
*/
public void write(final String database, final String retentionPolicy, final Point point);

/**
* Write a single Point to the database through UDP.
*/
public void write(final int udpPort, final Point point);

/**
* Write a set of Points to the influxdb database with the new lineprotocol.
*/
public void write(final BatchPoints batchPoints);

/**
* Write a set of Points to the influxdb database with the new lineprotocol.
*
* If batching is enabled with appropriate {@code BatchOptions} settings
* ({@code BatchOptions.bufferLimit} greater than {@code BatchOptions.actions})
* This method will try to retry in case of some recoverable errors.
* Otherwise it just works as {@link #write(BatchPoints)}
*/
public void writeWithRetry(final BatchPoints batchPoints);

/**
* Write a set of Points to the influxdb database with the string records.
*/
public void write(final String database, final String retentionPolicy,
final ConsistencyLevel consistency, final String records);

/**
* Write a set of Points to the influxdb database with the string records.
*/
public void write(final String database, final String retentionPolicy,
final ConsistencyLevel consistency, final TimeUnit precision, final String records);

/**
* Write a set of Points to the influxdb database with the list of string records.
*/
public void write(final String database, final String retentionPolicy,
final ConsistencyLevel consistency, final List<String> records);

/**
* Write a set of Points to the influxdb database with the list of string records.
*/
public void write(final String database, final String retentionPolicy,
final ConsistencyLevel consistency, final TimeUnit precision, final List<String> records);

/**
* Write a set of Points to the influxdb database with the string records through UDP.
*/
public void write(final int udpPort, final String records);

/**
* Write a set of Points to the influxdb database with the list of string records through UDP.
*/
public void write(final int udpPort, final List<String> records);

2. ping()

/**
* Ping this influxDB.
*/
public Pong ping();

3. version()

/**
* Return the version of the connected influxDB Server.
*/
public String version();

4. flush()

/**
* Send any buffered points to InfluxDB. This method is synchronous and will block while all pending points are
* written.
*/
public void flush();

5. close()

/**
* close thread for asynchronous batch write and UDP socket to release resources if need.
*/
public void close();

6. setDatabase()

/**
* Set the database which is used for writing points.
*/
public InfluxDB setDatabase(final String database);

二、进行中

1. query()

query函数有很多接口,主要的适配目标包括:支持常规过滤、值过滤和tag过滤。同时支持聚合函数,选择函数等等功能。

已经实现的接口有:

/**
* Execute a query against a database.
*/
public QueryResult query(final Query query);

/**
* Execute a query against a database.
*/
public void query(final Query query, final Consumer<QueryResult> onSuccess, final Consumer<Throwable> onFailure);

/**
* Execute a streaming query against a database.
*/
public void query(Query query, int chunkSize, Consumer<QueryResult> onNext);

/**
* Execute a streaming query against a database.
*/
public void query(Query query, int chunkSize, BiConsumer<Cancellable, QueryResult> onNext);

/**
* Execute a streaming query against a database.
*/
public void query(Query query, int chunkSize, Consumer<QueryResult> onNext, Runnable onComplete);

/**
* Execute a streaming query against a database.
*/
public void query(Query query, int chunkSize, BiConsumer<Cancellable, QueryResult> onNext, Runnable onComplete);

/**
* Execute a streaming query against a database.
*/
public void query(Query query, int chunkSize, BiConsumer<Cancellable, QueryResult> onNext, Runnable onComplete,
Consumer<Throwable> onFailure);

/**
* Execute a query against a database.
*/
public QueryResult query(final Query query, TimeUnit timeUnit);


  • No labels