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

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

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

InfluxDB.deleteDatabase介绍

[英]Delete a database.
[中]删除数据库。

代码示例

代码示例来源:origin: tzolov/geode-dashboard

@Override
protected void doCreateEmptyDatabase() {
  LOG.info("(Re)create influxDB [" + influxDatabaseName + "]");
  influxDB.deleteDatabase(influxDatabaseName);
  influxDB.createDatabase(influxDatabaseName);
}

代码示例来源:origin: tzolov/geode-dashboard

@Autowired
public JmxInfluxLoader(InfluxDB influxDB,
    MBeanServerConnection jmxConnection,
    @Value("${cleanDatabaseOnStart}") boolean cleanDatabaseOnStart,
    @Value("${influxRetentionPolicy}") String influxRetentionPolicy,
    @Value("${mbeanHostName}") String mbeanHostName,
    @Value("${mbeanPort}") String mbeanPort,
    @Value("${influxDatabaseName}") String influxDatabaseName,
    @Value("${cronExpression}") String cronExpression) {
  this.influxDB = influxDB;
  this.jmxConnection = jmxConnection;
  this.cleanDatabaseOnStart = cleanDatabaseOnStart;
  this.influxRetentionPolicy = influxRetentionPolicy;
  this.mbeanHostName = mbeanHostName;
  this.mbeanPort = mbeanPort;
  this.influxDatabaseName = influxDatabaseName;
  this.cronExpression = cronExpression;
  log.info("cronExpression: " + cronExpression);
  if (this.cleanDatabaseOnStart) {
    influxDB.deleteDatabase(influxDatabaseName);
    influxDB.createDatabase(this.influxDatabaseName);
  }
}

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

public InfluxDbConnectionFactory(final String url, final String uid,
                 final String psw, final String dbName,
                 final boolean dropDatabase) {
  if (StringUtils.isBlank(dbName) || StringUtils.isBlank(url)) {
    throw new IllegalArgumentException("Database name/url cannot be blank and must be specified");
  }
  val builder = new OkHttpClient.Builder();
  this.influxDb = InfluxDBFactory.connect(url, uid, psw, builder);
  this.influxDb.enableGzip();
  if (dropDatabase) {
    this.influxDb.deleteDatabase(dbName);
  }
  if (!this.influxDb.databaseExists(dbName)) {
    this.influxDb.createDatabase(dbName);
  }
  this.influxDb.setLogLevel(InfluxDB.LogLevel.NONE);
  if (LOGGER.isDebugEnabled()) {
    this.influxDb.setLogLevel(InfluxDB.LogLevel.FULL);
  } else if (LOGGER.isInfoEnabled()) {
    this.influxDb.setLogLevel(InfluxDB.LogLevel.BASIC);
  } else if (LOGGER.isWarnEnabled()) {
    this.influxDb.setLogLevel(InfluxDB.LogLevel.HEADERS);
  } else if (LOGGER.isErrorEnabled()) {
    this.influxDb.setLogLevel(InfluxDB.LogLevel.NONE);
  }
}

相关文章