org.influxdb.InfluxDB.setConsistency()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(181)

本文整理了Java中org.influxdb.InfluxDB.setConsistency()方法的一些代码示例,展示了InfluxDB.setConsistency()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。InfluxDB.setConsistency()方法的具体详情如下:
包路径:org.influxdb.InfluxDB
类名称:InfluxDB
方法名:setConsistency

InfluxDB.setConsistency介绍

[英]Set the consistency level which is used for writing points.
[中]设置用于写入点的一致性级别。

代码示例

代码示例来源:origin: influxdata/influxdb-java

@Override
public InfluxDB enableBatch(final int actions, final int flushDuration, final TimeUnit flushDurationTimeUnit,
              final ThreadFactory threadFactory,
              final BiConsumer<Iterable<Point>, Throwable> exceptionHandler,
              final ConsistencyLevel consistency) {
 enableBatch(actions, flushDuration, flushDurationTimeUnit, threadFactory, exceptionHandler)
   .setConsistency(consistency);
 return this;
}

代码示例来源:origin: org.influxdb/influxdb-java

@Override
public InfluxDB enableBatch(final int actions, final int flushDuration, final TimeUnit flushDurationTimeUnit,
              final ThreadFactory threadFactory,
              final BiConsumer<Iterable<Point>, Throwable> exceptionHandler,
              final ConsistencyLevel consistency) {
 enableBatch(actions, flushDuration, flushDurationTimeUnit, threadFactory, exceptionHandler)
   .setConsistency(consistency);
 return this;
}

代码示例来源:origin: org.apereo.cas/cas-server-support-influxdb-core

/**
 * Instantiates a new Influx db connection factory.
 *
 * @param props the props
 */
public InfluxDbConnectionFactory(final InfluxDbProperties props) {
  this(props.getUrl(), props.getUsername(), props.getPassword(), props.getDatabase(), props.isDropDatabase());
  if (StringUtils.isNotBlank(props.getRetentionPolicy())) {
    this.influxDb.setRetentionPolicy(props.getRetentionPolicy());
  }
  influxDb.setConsistency(InfluxDB.ConsistencyLevel.valueOf(props.getConsistencyLevel().toUpperCase()));
  if (props.getPointsToFlush() > 0 && StringUtils.isNotBlank(props.getBatchInterval())) {
    val interval = (int) Beans.newDuration(props.getBatchInterval()).toMillis();
    this.influxDb.enableBatch(props.getPointsToFlush(), interval, TimeUnit.MILLISECONDS);
  }
  this.influxDbProperties = props;
}

相关文章