Re: [PR] refactor: remove direct usage of couchDB client
bossenti merged PR #2757: URL: https://github.com/apache/streampipes/pull/2757 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@streampipes.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] refactor: remove direct usage of couchDB client
bossenti commented on code in PR #2757: URL: https://github.com/apache/streampipes/pull/2757#discussion_r1580582194 ## streampipes-data-explorer/src/main/java/org/apache/streampipes/dataexplorer/DataExplorerSchemaManagement.java: ## @@ -126,34 +117,20 @@ public void deleteMeasurement(String elementId) { @Override public boolean deleteMeasurementByName(String measureName) { boolean isSuccess = false; -CouchDbClient couchDbClient = Utils.getCouchDbDataLakeClient(); -List docs = couchDbClient.view("_all_docs") - .includeDocs(true) - .query(JsonObject.class); - -for (JsonObject document : docs) { - if (document.get("measureName") - .toString() +List docs = dataLakeStorage.getAllDataLakeMeasures(); + +for (var measure : docs) { + if (measure.getMeasureName() .replace("\"", "") Review Comment: Performed some investigation: The replace statements are not necessary (anymore). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@streampipes.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] refactor: remove direct usage of couchDB client
tenthe commented on code in PR #2757: URL: https://github.com/apache/streampipes/pull/2757#discussion_r1578977935 ## streampipes-data-explorer/src/main/java/org/apache/streampipes/dataexplorer/DataExplorerSchemaManagement.java: ## @@ -126,34 +117,20 @@ public void deleteMeasurement(String elementId) { @Override public boolean deleteMeasurementByName(String measureName) { boolean isSuccess = false; -CouchDbClient couchDbClient = Utils.getCouchDbDataLakeClient(); -List docs = couchDbClient.view("_all_docs") - .includeDocs(true) - .query(JsonObject.class); - -for (JsonObject document : docs) { - if (document.get("measureName") - .toString() +List docs = dataLakeStorage.getAllDataLakeMeasures(); + +for (var measure : docs) { + if (measure.getMeasureName() .replace("\"", "") Review Comment: Sorry, I am also not quite sure why they are there. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@streampipes.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] refactor: remove direct usage of couchDB client
bossenti commented on code in PR #2757: URL: https://github.com/apache/streampipes/pull/2757#discussion_r1575786384 ## streampipes-data-explorer/src/main/java/org/apache/streampipes/dataexplorer/DataExplorerSchemaManagement.java: ## @@ -126,34 +117,20 @@ public void deleteMeasurement(String elementId) { @Override public boolean deleteMeasurementByName(String measureName) { boolean isSuccess = false; -CouchDbClient couchDbClient = Utils.getCouchDbDataLakeClient(); -List docs = couchDbClient.view("_all_docs") - .includeDocs(true) - .query(JsonObject.class); - -for (JsonObject document : docs) { - if (document.get("measureName") - .toString() +List docs = dataLakeStorage.getAllDataLakeMeasures(); + +for (var measure : docs) { + if (measure.getMeasureName() .replace("\"", "") Review Comment: I'd assume that I can replace the two `replace()` statements as well. What do you think? Do I miss anything? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@streampipes.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org