This is an automated email from the ASF dual-hosted git repository.

jackie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new 0d08316dbf Updated the response for reload API to be pretty printed 
(#11608)
0d08316dbf is described below

commit 0d08316dbfecd3e5ec90800d0f494929d28a27c2
Author: Arnav Balyan <60175178+arnavbal...@users.noreply.github.com>
AuthorDate: Thu Oct 19 12:13:40 2023 +0530

    Updated the response for reload API to be pretty printed (#11608)
---
 .../pinot/controller/api/resources/PinotSegmentRestletResource.java  | 2 +-
 pinot-controller/src/main/resources/app/pages/TenantDetails.tsx      | 2 +-
 .../pinot/integration/tests/BaseClusterIntegrationTestSet.java       | 5 ++---
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git 
a/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentRestletResource.java
 
b/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentRestletResource.java
index 7a5961c680..19250c13af 100644
--- 
a/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentRestletResource.java
+++ 
b/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentRestletResource.java
@@ -786,7 +786,7 @@ public class PinotSegmentRestletResource {
         LOGGER.error("Failed to add reload all segments job meta into 
zookeeper for table: {}", tableNameWithType, e);
       }
     }
-    return new SuccessResponse("Segment reload details: " + 
JsonUtils.objectToString(perTableMsgData));
+    return new SuccessResponse(JsonUtils.objectToString(perTableMsgData));
   }
 
   @Deprecated
diff --git a/pinot-controller/src/main/resources/app/pages/TenantDetails.tsx 
b/pinot-controller/src/main/resources/app/pages/TenantDetails.tsx
index a67c187044..13b65ae0d1 100644
--- a/pinot-controller/src/main/resources/app/pages/TenantDetails.tsx
+++ b/pinot-controller/src/main/resources/app/pages/TenantDetails.tsx
@@ -337,7 +337,7 @@ const TenantPageDetails = ({ match }: 
RouteComponentProps<Props>) => {
 
     try {
       // extract reloadJobId from response
-      const statusResponseObj = JSON.parse(result.status.replace("Segment 
reload details: ", ""))
+      const statusResponseObj = JSON.parse(result.status)
       reloadJobId = get(statusResponseObj, `${tableName}.reloadJobId`, null)
     } catch {
       reloadJobId = null;
diff --git 
a/pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/BaseClusterIntegrationTestSet.java
 
b/pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/BaseClusterIntegrationTestSet.java
index 9ce9c69959..9af3802c68 100644
--- 
a/pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/BaseClusterIntegrationTestSet.java
+++ 
b/pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/BaseClusterIntegrationTestSet.java
@@ -27,7 +27,6 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.helix.PropertyKey;
 import org.apache.helix.model.ExternalView;
@@ -655,8 +654,8 @@ public abstract class BaseClusterIntegrationTestSet extends 
BaseClusterIntegrati
     String response =
         sendPostRequest(_controllerRequestURLBuilder.forTableReload(tableName, 
tableType, forceDownload), null);
     String tableNameWithType = 
TableNameBuilder.forType(tableType).tableNameWithType(tableName);
-    JsonNode tableLevelDetails =
-        
JsonUtils.stringToJsonNode(StringEscapeUtils.unescapeJava(response.split(": 
")[1])).get(tableNameWithType);
+    JsonNode responseJson = JsonUtils.stringToJsonNode(response);
+    JsonNode tableLevelDetails = 
JsonUtils.stringToJsonNode(responseJson.get("status").asText()).get(tableNameWithType);
     String isZKWriteSuccess = 
tableLevelDetails.get("reloadJobMetaZKStorageStatus").asText();
     assertEquals(isZKWriteSuccess, "SUCCESS");
     String jobId = tableLevelDetails.get("reloadJobId").asText();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to