Skip to content
This repository has been archived by the owner on Dec 26, 2024. It is now read-only.

Commit

Permalink
fix: use stable release of influxdb-client-java, fix restarting InfluxDB
Browse files Browse the repository at this point in the history
  • Loading branch information
bednar committed Dec 6, 2019
1 parent cac52ae commit e488e64
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public void invalidFlux() {
runner.assertTransferCount(GetInfluxDatabaseRecord_2.REL_FAILURE, 1);

MockFlowFile flowFile = runner.getFlowFilesForRelationship(GetInfluxDatabaseRecord_2.REL_FAILURE).get(0);
Assert.assertEquals("internal error", flowFile.getAttribute(AbstractInfluxDatabaseProcessor.INFLUX_DB_ERROR_MESSAGE));
Assert.assertEquals("type error 1:45-1:51: undefined identifier \"rangex\"", flowFile.getAttribute(AbstractInfluxDatabaseProcessor.INFLUX_DB_ERROR_MESSAGE));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public void invalidFlux() {
runner.assertTransferCount(GetInfluxDatabase_2.REL_FAILURE, 1);

MockFlowFile flowFile = runner.getFlowFilesForRelationship(GetInfluxDatabaseRecord_2.REL_FAILURE).get(0);
Assert.assertEquals("internal error", flowFile.getAttribute(AbstractInfluxDatabaseProcessor.INFLUX_DB_ERROR_MESSAGE));
Assert.assertEquals("type error 1:45-1:51: undefined identifier \"rangex\"", flowFile.getAttribute(AbstractInfluxDatabaseProcessor.INFLUX_DB_ERROR_MESSAGE));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void testBadFormat() {
List<MockFlowFile> flowFiles = runner.getFlowFilesForRelationship(AbstractInfluxDatabaseProcessor.REL_FAILURE);

assertEquals(1, flowFiles.size());
assertEquals("unable to parse points: unable to parse 'water,country=US,city=newark': missing fields",
assertEquals("unable to parse 'water,country=US,city=newark': missing fields",
flowFiles.get(0).getAttribute(AbstractInfluxDatabaseProcessor.INFLUX_DB_ERROR_MESSAGE));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import java.util.function.Supplier;

import com.influxdb.client.InfluxDBClient;
import com.influxdb.client.domain.Check;
import com.influxdb.client.domain.HealthCheck;

import edu.umd.cs.findbugs.annotations.NonNull;
import org.apache.nifi.components.PropertyDescriptor;
Expand Down Expand Up @@ -69,9 +69,9 @@ protected void assertConnectToDatabase() throws IOException, GeneralSecurityExce

InfluxDBClient client = service.create();

Check result = client.health();
HealthCheck result = client.health();

Assert.assertEquals("Unexpected health check: " + result, Check.StatusEnum.PASS, result.getStatus());
Assert.assertEquals("Unexpected health check: " + result, HealthCheck.StatusEnum.PASS, result.getStatus());
}

public static class ServiceProcessor extends AbstractProcessor {
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
<dependency>
<groupId>com.influxdb</groupId>
<artifactId>influxdb-client-java</artifactId>
<version>1.0.0.M2-SNAPSHOT</version>
<version>1.2.0</version>
</dependency>

<dependency>
Expand Down
7 changes: 5 additions & 2 deletions scripts/influxdb-restart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ docker run \
--volume ${SCRIPT_PATH}/../nifi-influx-database-services/src/test/resources/influxdb.conf:/etc/influxdb/influxdb.conf \
${INFLUXDB_IMAGE}

echo "Wait to start InfluxDB"
wget -S --spider --tries=20 --retry-connrefused --waitretry=5 http://localhost:8086/ping

echo
echo "Starting secured InfluxDB..."
echo
Expand Down Expand Up @@ -89,8 +92,8 @@ docker run \
--publish 9999:9999 \
${INFLUXDB_V2_IMAGE}

echo "Wait 5s to start InfluxDB 2.0"
sleep 5
echo "Wait to start InfluxDB 2.0"
wget -S --spider --tries=20 --retry-connrefused --waitretry=5 http://localhost:9999/metrics

echo
echo "Post onBoarding request, to setup initial user (my-user@my-password), org (my-org) and bucket (my-bucket)"
Expand Down

0 comments on commit e488e64

Please sign in to comment.