类 InfluxdbTemplate
java.lang.Object
cn.herodotus.stirrup.tsdb.influxdb.core.InfluxdbTemplate
Description: TODO
- 作者:
- : gengwei.zheng
- Date:
- : 2023/11/4 17:16
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidbatchInsert(String database, String retentionPolicy, org.influxdb.InfluxDB.ConsistencyLevel consistency, TimeUnit precision, List<String> records) 批量将多个记录写入数据库voidbatchInsert(String database, String retentionPolicy, org.influxdb.InfluxDB.ConsistencyLevel consistency, TimeUnit precision, List<org.influxdb.dto.Point> points, Map<String, String> tags) 批量插入数据voidbatchInsert(String database, String retentionPolicy, org.influxdb.InfluxDB.ConsistencyLevel consistency, List<String> records) 批量将多个记录写入数据库voidbatchInsert(String database, List<String> records) 批量将多个记录写入数据库void批量插入数据voidbatchInsert(List<org.influxdb.dto.Point> points) 批量插入数据voidbatchInsert(List<org.influxdb.dto.Point> points, Map<String, String> tags) 批量插入数据voidbatchInsert(org.influxdb.dto.BatchPoints batchPoints) 批量插入数据voidcreateDatabase(String databaseName) 创建数据库voiddeleteDatabase(String databaseName) 删除数据库voidinsert(String measurement, Long time, TimeUnit precision, Map<String, Object> fields, Map<String, String> tags) 将单个点写入默认数据库void将单个记录写入数据库voidinsert(String database, String retentionPolicy, org.influxdb.InfluxDB.ConsistencyLevel consistency, String records) 将单个记录写入数据库voidinsert(String database, String retentionPolicy, org.influxdb.InfluxDB.ConsistencyLevel consistency, TimeUnit precision, String records) 将单个记录写入数据库void将单个点写入默认数据库void将单个点写入默认数据库voidinsertWithUDP(String measurement, Long time, TimeUnit precision, Map<String, Object> fields, Map<String, String> tags) 将单个点写入默认数据库voidinsertWithUDP(String measurement, Map<String, Object> fields) 将单个点写入默认数据库void将单个点写入默认数据库booleanping()测试连接是否正常org.influxdb.dto.QueryResult对数据库执行查询org.influxdb.dto.QueryResult对数据库执行查询org.influxdb.dto.QueryResult对数据库执行查询voidquery(String command, String database, boolean requiresPost, int chunkSize, BiConsumer<org.influxdb.InfluxDB.Cancellable, org.influxdb.dto.QueryResult> onNext) 对数据库执行查询voidquery(String command, String database, boolean requiresPost, int chunkSize, BiConsumer<org.influxdb.InfluxDB.Cancellable, org.influxdb.dto.QueryResult> onNext, Runnable onComplete) 对数据库执行查询voidquery(String command, String database, boolean requiresPost, int chunkSize, BiConsumer<org.influxdb.InfluxDB.Cancellable, org.influxdb.dto.QueryResult> onNext, Runnable onComplete, Consumer<Throwable> onFailure) 对数据库执行查询voidquery(String command, String database, boolean requiresPost, int chunkSize, Consumer<org.influxdb.dto.QueryResult> onNext) 对数据库执行查询voidquery(String command, String database, boolean requiresPost, int chunkSize, Consumer<org.influxdb.dto.QueryResult> onNext, Runnable onComplete) 对数据库执行查询org.influxdb.dto.QueryResult对数据库执行查询voidquery(String command, String database, boolean requiresPost, Consumer<org.influxdb.dto.QueryResult> onSuccess, Consumer<Throwable> onFailure) 对数据库执行查询voidquery(String command, String database, int chunkSize, BiConsumer<org.influxdb.InfluxDB.Cancellable, org.influxdb.dto.QueryResult> onNext) 对数据库执行查询voidquery(String command, String database, int chunkSize, BiConsumer<org.influxdb.InfluxDB.Cancellable, org.influxdb.dto.QueryResult> onNext, Runnable onComplete) 对数据库执行查询voidquery(String command, String database, int chunkSize, BiConsumer<org.influxdb.InfluxDB.Cancellable, org.influxdb.dto.QueryResult> onNext, Runnable onComplete, Consumer<Throwable> onFailure) 对数据库执行查询voidquery(String command, String database, int chunkSize, Consumer<org.influxdb.dto.QueryResult> onNext) 对数据库执行查询voidquery(String command, String database, int chunkSize, Consumer<org.influxdb.dto.QueryResult> onNext, Runnable onComplete) 对数据库执行查询org.influxdb.dto.QueryResult对数据库执行查询voidquery(String command, String database, Consumer<org.influxdb.dto.QueryResult> onSuccess, Consumer<Throwable> onFailure) 对数据库执行查询org.influxdb.dto.QueryResult对数据库执行查询org.influxdb.dto.QueryResultquery(org.influxdb.dto.Query query) 对数据库执行查询voidquery(org.influxdb.dto.Query query, int chunkSize, BiConsumer<org.influxdb.InfluxDB.Cancellable, org.influxdb.dto.QueryResult> onNext) 对数据库执行查询voidquery(org.influxdb.dto.Query query, int chunkSize, BiConsumer<org.influxdb.InfluxDB.Cancellable, org.influxdb.dto.QueryResult> onNext, Runnable onComplete) 对数据库执行查询voidquery(org.influxdb.dto.Query query, int chunkSize, BiConsumer<org.influxdb.InfluxDB.Cancellable, org.influxdb.dto.QueryResult> onNext, Runnable onComplete, Consumer<Throwable> onFailure) 对数据库执行查询void对数据库执行查询voidquery(org.influxdb.dto.Query query, int chunkSize, Consumer<org.influxdb.dto.QueryResult> onNext, Runnable onComplete) 对数据库执行查询org.influxdb.dto.QueryResult对数据库执行查询voidquery(org.influxdb.dto.Query query, Consumer<org.influxdb.dto.QueryResult> onSuccess, Consumer<Throwable> onFailure) 对数据库执行查询
-
构造器详细资料
-
InfluxdbTemplate
-
-
方法详细资料
-
ping
public boolean ping()测试连接是否正常- 返回:
- true 连接正常,false 连接失败
-
batchInsert
public void batchInsert(org.influxdb.dto.BatchPoints batchPoints) 批量插入数据- 参数:
batchPoints- 数据BatchPoints
-
batchInsert
批量插入数据- 参数:
points- 数据
-
batchInsert
批量插入数据- 参数:
points- 数据tags- 标签
-
batchInsert
public void batchInsert(String database, List<org.influxdb.dto.Point> points, Map<String, String> tags) 批量插入数据- 参数:
database- 数据库。为空则使用外部配置值points- 数据tags- 标签
-
batchInsert
public void batchInsert(String database, String retentionPolicy, org.influxdb.InfluxDB.ConsistencyLevel consistency, TimeUnit precision, List<org.influxdb.dto.Point> points, Map<String, String> tags) 批量插入数据- 参数:
database- 数据库。为空则使用外部配置值retentionPolicy- 保留策略,为空则使用外部配置值consistency- 一致性级别,为空则使用外部配置值precision- 时间单位 ,为空则使用外部配置值points- 数据tags- 标签
-
batchInsert
批量将多个记录写入数据库- 参数:
database- 数据库records- 记录
-
batchInsert
public void batchInsert(String database, String retentionPolicy, org.influxdb.InfluxDB.ConsistencyLevel consistency, List<String> records) 批量将多个记录写入数据库- 参数:
database- 数据库retentionPolicy- 保留策略consistency- 一致性records- 记录
-
batchInsert
public void batchInsert(String database, String retentionPolicy, org.influxdb.InfluxDB.ConsistencyLevel consistency, TimeUnit precision, List<String> records) 批量将多个记录写入数据库- 参数:
database- 数据库retentionPolicy- 保留策略consistency- 一致性precision- 时间单位records- 记录
-
insert
将单个记录写入数据库- 参数:
database- 数据库records- 记录
-
insert
public void insert(String database, String retentionPolicy, org.influxdb.InfluxDB.ConsistencyLevel consistency, String records) 将单个记录写入数据库- 参数:
database- 数据库retentionPolicy- 保留策略consistency- 一致性records- 记录
-
insert
public void insert(String database, String retentionPolicy, org.influxdb.InfluxDB.ConsistencyLevel consistency, TimeUnit precision, String records) 将单个记录写入数据库- 参数:
database- 数据库retentionPolicy- 保留策略consistency- 一致性precision- 时间单位records- 记录
-
insert
将单个点写入默认数据库- 参数:
measurement- 度量(表)fields- 字段
-
insert
将单个点写入默认数据库- 参数:
measurement- 度量(表)fields- 字段tags- 标签
-
insert
public void insert(String measurement, Long time, TimeUnit precision, Map<String, Object> fields, Map<String, String> tags) 将单个点写入默认数据库- 参数:
measurement- 度量(表)time- 时间precision- 单位fields- 字段tags- 标签
-
insertWithUDP
将单个点写入默认数据库influxDB开启UDP功能, 默认端口:8089,默认数据库:udp,没提供代码传数据库功能接口 使用UDP的原因: TCP数据传输慢,UDP数据传输快。网络带宽需求较小,而实时性要求高。 InfluxDB和服务器在同机房,发生数据丢包的可能性较小,即使真的发生丢包,对整个请求流量的收集影响也较小。
- 参数:
measurement- 度量(表)fields- 字段
-
insertWithUDP
将单个点写入默认数据库influxDB开启UDP功能, 默认端口:8089,默认数据库:udp,没提供代码传数据库功能接口 使用UDP的原因: TCP数据传输慢,UDP数据传输快。网络带宽需求较小,而实时性要求高。 InfluxDB和服务器在同机房,发生数据丢包的可能性较小,即使真的发生丢包,对整个请求流量的收集影响也较小。
- 参数:
measurement- 度量(表)fields- 字段tags- 标签
-
insertWithUDP
public void insertWithUDP(String measurement, Long time, TimeUnit precision, Map<String, Object> fields, Map<String, String> tags) 将单个点写入默认数据库influxDB开启UDP功能, 默认端口:8089,默认数据库:udp,没提供代码传数据库功能接口 使用UDP的原因: TCP数据传输慢,UDP数据传输快。网络带宽需求较小,而实时性要求高。 InfluxDB和服务器在同机房,发生数据丢包的可能性较小,即使真的发生丢包,对整个请求流量的收集影响也较小。
- 参数:
measurement- 度量(表)time- 时间precision- 单位fields- 字段tags- 标签
-
query
对数据库执行查询- 参数:
command- 查询命令- 返回:
- 查询结果
QueryResult
-
query
对数据库执行查询- 参数:
command- 查询命令database- 数据库- 返回:
- 查询结果
QueryResult
-
query
对数据库执行查询- 参数:
command- 查询命令database- 数据库requiresPost- 如果命令需要POST而不是GET到influxdb,则为true- 返回:
- 查询结果
QueryResult
-
query
public org.influxdb.dto.QueryResult query(org.influxdb.dto.Query query) 对数据库执行查询- 参数:
query- 查询参数Query- 返回:
- 查询结果
QueryResult
-
query
对数据库执行查询- 参数:
command- 查询命令timeUnit- 结果的时间单位- 返回:
- 查询结果
QueryResult
-
query
对数据库执行查询- 参数:
command- 查询命令database- 数据库timeUnit- 结果的时间单位- 返回:
- 查询结果
QueryResult
-
query
public org.influxdb.dto.QueryResult query(String command, String database, boolean requiresPost, TimeUnit timeUnit) 对数据库执行查询- 参数:
command- 查询命令database- 数据库requiresPost- 如果命令需要POST而不是GET到influxdb,则为truetimeUnit- 结果的时间单位- 返回:
- 查询结果
QueryResult
-
query
对数据库执行查询- 参数:
query- 查询参数QuerytimeUnit- 结果的时间单位- 返回:
- 查询结果
QueryResult
-
query
public void query(String command, String database, int chunkSize, Consumer<org.influxdb.dto.QueryResult> onNext) 对数据库执行查询- 参数:
command- 查询命令database- 数据库chunkSize- 一个区块中要处理的QueryResults的数量onNext- 要为每个接收到的QueryResult调用的使用者
-
query
public void query(String command, String database, boolean requiresPost, int chunkSize, Consumer<org.influxdb.dto.QueryResult> onNext) 对数据库执行查询- 参数:
command- 查询命令database- 数据库requiresPost- 如果命令需要POST而不是GET到influxdb,则为truechunkSize- 一个区块中要处理的QueryResults的数量onNext- 要为每个接收到的QueryResult调用的使用者
-
query
public void query(org.influxdb.dto.Query query, int chunkSize, Consumer<org.influxdb.dto.QueryResult> onNext) 对数据库执行查询- 参数:
query- 查询参数QuerychunkSize- 一个区块中要处理的QueryResults的数量onNext- 要为每个接收到的QueryResult调用的使用者
-
query
public void query(String command, String database, int chunkSize, Consumer<org.influxdb.dto.QueryResult> onNext, Runnable onComplete) 对数据库执行查询- 参数:
command- 查询命令database- 数据库chunkSize- 一个区块中要处理的QueryResults的数量onNext- 要为每个接收到的QueryResult调用的使用者onComplete- 要调用以成功结束流的onComplete
-
query
public void query(String command, String database, boolean requiresPost, int chunkSize, Consumer<org.influxdb.dto.QueryResult> onNext, Runnable onComplete) 对数据库执行查询- 参数:
command- 查询命令database- 数据库requiresPost- 如果命令需要POST而不是GET到influxdb,则为truechunkSize- 一个区块中要处理的QueryResults的数量onNext- 要为每个接收到的QueryResult调用的使用者onComplete- 要调用以成功结束流的onComplete
-
query
public void query(org.influxdb.dto.Query query, int chunkSize, Consumer<org.influxdb.dto.QueryResult> onNext, Runnable onComplete) 对数据库执行查询- 参数:
query- 查询参数QuerychunkSize- 一个区块中要处理的QueryResults的数量onNext- 要为每个接收到的QueryResult调用的使用者onComplete- 要调用以成功结束流的onComplete
-
query
public void query(String command, String database, int chunkSize, BiConsumer<org.influxdb.InfluxDB.Cancellable, org.influxdb.dto.QueryResult> onNext) 对数据库执行查询- 参数:
command- 查询命令database- 数据库chunkSize- 一个区块中要处理的QueryResults的数量onNext- 消费者为每个接收到的QueryResult调用;具有中断流式查询的功能
-
query
public void query(String command, String database, boolean requiresPost, int chunkSize, BiConsumer<org.influxdb.InfluxDB.Cancellable, org.influxdb.dto.QueryResult> onNext) 对数据库执行查询- 参数:
command- 查询命令database- 数据库requiresPost- 如果命令需要POST而不是GET到influxdb,则为truechunkSize- 一个区块中要处理的QueryResults的数量onNext- 消费者为每个接收到的QueryResult调用;具有中断流式查询的功能
-
query
public void query(org.influxdb.dto.Query query, int chunkSize, BiConsumer<org.influxdb.InfluxDB.Cancellable, org.influxdb.dto.QueryResult> onNext) 对数据库执行查询- 参数:
query- 查询参数QuerychunkSize- 一个区块中要处理的QueryResults的数量onNext- 消费者为每个接收到的QueryResult调用;具有中断流式查询的功能
-
query
public void query(String command, String database, int chunkSize, BiConsumer<org.influxdb.InfluxDB.Cancellable, org.influxdb.dto.QueryResult> onNext, Runnable onComplete) 对数据库执行查询- 参数:
command- 查询命令database- 数据库chunkSize- 一个区块中要处理的QueryResults的数量onNext- 消费者为每个接收到的QueryResult调用;具有中断流式查询的功能onComplete- 要调用以成功结束流的onComplete
-
query
public void query(String command, String database, boolean requiresPost, int chunkSize, BiConsumer<org.influxdb.InfluxDB.Cancellable, org.influxdb.dto.QueryResult> onNext, Runnable onComplete) 对数据库执行查询- 参数:
command- 查询命令database- 数据库requiresPost- 如果命令需要POST而不是GET到influxdb,则为truechunkSize- 一个区块中要处理的QueryResults的数量onNext- 消费者为每个接收到的QueryResult调用;具有中断流式查询的功能onComplete- 要调用以成功结束流的onComplete
-
query
public void query(org.influxdb.dto.Query query, int chunkSize, BiConsumer<org.influxdb.InfluxDB.Cancellable, org.influxdb.dto.QueryResult> onNext, Runnable onComplete) 对数据库执行查询- 参数:
query- 查询参数QuerychunkSize- 一个区块中要处理的QueryResults的数量onNext- 消费者为每个接收到的QueryResult调用;具有中断流式查询的功能onComplete- 要调用以成功结束流的onComplete
-
query
public void query(String command, String database, int chunkSize, BiConsumer<org.influxdb.InfluxDB.Cancellable, org.influxdb.dto.QueryResult> onNext, Runnable onComplete, Consumer<Throwable> onFailure) 对数据库执行查询- 参数:
command- 查询命令database- 数据库chunkSize- 一个区块中要处理的QueryResults的数量onNext- 消费者为每个接收到的QueryResult调用;具有中断流式查询的功能onComplete- 要调用以成功结束流的onCompleteonFailure- 错误处理的使用者
-
query
public void query(String command, String database, boolean requiresPost, int chunkSize, BiConsumer<org.influxdb.InfluxDB.Cancellable, org.influxdb.dto.QueryResult> onNext, Runnable onComplete, Consumer<Throwable> onFailure) 对数据库执行查询- 参数:
command- 查询命令database- 数据库requiresPost- 如果命令需要POST而不是GET到influxdb,则为truechunkSize- 一个区块中要处理的QueryResults的数量onNext- 消费者为每个接收到的QueryResult调用;具有中断流式查询的功能onComplete- 要调用以成功结束流的onCompleteonFailure- 错误处理的使用者
-
query
public void query(org.influxdb.dto.Query query, int chunkSize, BiConsumer<org.influxdb.InfluxDB.Cancellable, org.influxdb.dto.QueryResult> onNext, Runnable onComplete, Consumer<Throwable> onFailure) 对数据库执行查询- 参数:
query- 查询参数QuerychunkSize- 一个区块中要处理的QueryResults的数量onNext- 消费者为每个接收到的QueryResult调用;具有中断流式查询的功能onComplete- 要调用以成功结束流的onCompleteonFailure- 错误处理的使用者
-
query
public void query(String command, String database, Consumer<org.influxdb.dto.QueryResult> onSuccess, Consumer<Throwable> onFailure) 对数据库执行查询- 参数:
command- 查询命令database- 数据库onSuccess- 收到结果时要调用的使用者onFailure- 引发错误时要调用的使用者
-
query
public void query(String command, String database, boolean requiresPost, Consumer<org.influxdb.dto.QueryResult> onSuccess, Consumer<Throwable> onFailure) 对数据库执行查询- 参数:
command- 查询命令database- 数据库requiresPost- 如果命令需要POST而不是GET到influxdb,则为trueonSuccess- 收到结果时要调用的使用者onFailure- 引发错误时要调用的使用者
-
query
public void query(org.influxdb.dto.Query query, Consumer<org.influxdb.dto.QueryResult> onSuccess, Consumer<Throwable> onFailure) 对数据库执行查询- 参数:
query- 查询参数QueryonSuccess- 收到结果时要调用的使用者onFailure- 引发错误时要调用的使用者
-
createDatabase
创建数据库- 参数:
databaseName- 数据库名称
-
deleteDatabase
删除数据库- 参数:
databaseName- 数据库名称
-