This is an automated email from the ASF dual-hosted git repository.
fjohn pushed a commit to branch datalake-rest-extension
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git
The following commit(s) were added to refs/heads/datalake-rest-extension by
this push:
new 935c50f Fix: Variable for Database Name
935c50f is described below
commit 935c50f812ef5386904d088f1fb4beec4792aa05
Author: Felix John <[email protected]>
AuthorDate: Thu Sep 24 08:51:29 2020 +0200
Fix: Variable for Database Name
---
.../streampipes/rest/impl/datalake/DataLakeManagementV3.java | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git
a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/DataLakeManagementV3.java
b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/DataLakeManagementV3.java
index fad123a..f29a2bd 100644
---
a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/DataLakeManagementV3.java
+++
b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/DataLakeManagementV3.java
@@ -232,7 +232,7 @@ public class DataLakeManagementV3 {
public DataResult getRetentionPoliciesOfDatabase() {
InfluxDB influxDB = getInfluxDBClient();
- Query query = new Query("SHOW RETENTION POLICIES ON sp");
+ Query query = new Query("SHOW RETENTION POLICIES ON " +
BackendConfig.INSTANCE.getInfluxDatabaseName());
QueryResult influx_result = influxDB.query(query);
DataResult dataResult = convertResult(influx_result);
influxDB.close();
@@ -254,7 +254,8 @@ public class DataLakeManagementV3 {
Query query = new Query("CREATE RETENTION POLICY "
+ policyName
- + " ON sp "
+ + " ON "
+ + BackendConfig.INSTANCE.getInfluxDatabaseName()
+ durationString
+ replicationString
+ shardDurationString
@@ -283,7 +284,8 @@ public class DataLakeManagementV3 {
Query query = new Query("ALTER RETENTION POLICY "
+ policyName
- + " ON sp "
+ + " ON "
+ + BackendConfig.INSTANCE.getInfluxDatabaseName()
+ durationString
+ replicationString
+ shardDurationString
@@ -301,7 +303,8 @@ public class DataLakeManagementV3 {
InfluxDB influxDB = getInfluxDBClient();
Query query = new Query("DROP RETENTION POLICY "
+ policyName
- + " ON sp ",
+ + " ON "
+ + BackendConfig.INSTANCE.getInfluxDatabaseName(),
BackendConfig.INSTANCE.getInfluxDatabaseName());
QueryResult influx_result = influxDB.query(query);
@@ -347,6 +350,7 @@ public class DataLakeManagementV3 {
DataLakeManagementV3 dlmv3 = new DataLakeManagementV3();
InfluxDB influxDB = dlmv3.getInfluxDBClient();
long size = dlmv3.getStorageSizeOfDatabase();
+ dlmv3.deleteRetentionPolicy("rp10");
// DataResult result = dlmv3.getRetentionPoliciesOfDatabase();
// dlmv3.createRetentionPolicy("rp8", "1h", null, 5, Boolean.FALSE);
// dlmv3.getNumOfRecordsOfTable("john3800");