Skip to content

Commit d6437d5

Browse files
Gabriel Beims Bräscheryadvr
authored andcommitted
server: use latest InfluxDB (2.15), add support to Batch Mode (#3289)
The InfluxDB Java client supports Batch Mode at versions 2.9+ [1]. Thus, this PR updated to the latest InfluxDB (2.15), adding support to Batch Mode [1] https://github.com/influxdata/influxdb-java
1 parent 89d5480 commit d6437d5

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@
130130
<cs.guava.version>23.6-jre</cs.guava.version>
131131
<cs.httpclient.version>4.5.4</cs.httpclient.version>
132132
<cs.httpcore.version>4.4.8</cs.httpcore.version>
133+
<cs.influxdb-java.version>2.15</cs.influxdb-java.version>
133134
<cs.jackson.version>2.9.2</cs.jackson.version>
134135
<cs.jasypt.version>1.9.2</cs.jasypt.version>
135136
<cs.java-ipv6.version>0.16</cs.java-ipv6.version>
@@ -524,6 +525,11 @@
524525
<artifactId>groovy-all</artifactId>
525526
<version>${cs.groovy.version}</version>
526527
</dependency>
528+
<dependency>
529+
<groupId>org.influxdb</groupId>
530+
<artifactId>influxdb-java</artifactId>
531+
<version>${cs.influxdb-java.version}</version>
532+
</dependency>
527533
<dependency>
528534
<groupId>org.eclipse.jetty</groupId>
529535
<artifactId>jetty-jmx</artifactId>

server/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@
160160
<dependency>
161161
<groupId>org.influxdb</groupId>
162162
<artifactId>influxdb-java</artifactId>
163-
<version>2.8</version>
164163
</dependency>
165164
</dependencies>
166165
<build>

server/src/main/java/com/cloud/server/StatsCollector.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
import org.apache.commons.collections.MapUtils;
5252
import org.apache.commons.lang.StringUtils;
5353
import org.apache.log4j.Logger;
54+
import org.influxdb.BatchOptions;
5455
import org.influxdb.InfluxDB;
5556
import org.influxdb.InfluxDBFactory;
5657
import org.influxdb.dto.BatchPoints;
@@ -1502,6 +1503,7 @@ protected InfluxDB createInfluxDbConnection() {
15021503
*/
15031504
protected void writeBatches(InfluxDB influxDbConnection, String dbName, List<Point> points) {
15041505
BatchPoints batchPoints = BatchPoints.database(dbName).build();
1506+
influxDbConnection.enableBatch(BatchOptions.DEFAULTS);
15051507

15061508
for (Point point : points) {
15071509
batchPoints.point(point);

0 commit comments

Comments
 (0)