walterddr commented on a change in pull request #8305:
URL: https://github.com/apache/pinot/pull/8305#discussion_r821866266



##########
File path: 
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/ZookeeperResource.java
##########
@@ -187,14 +181,47 @@ public String ls(
 
     path = validateAndNormalizeZKPath(path, true);
 
-    List<String> children = _pinotHelixResourceManager.getZKChildren(path);
+    List<String> children = _pinotHelixResourceManager.getZKChildNames(path);
     try {
       return JsonUtils.objectToString(children);
     } catch (JsonProcessingException e) {
       throw new RuntimeException(e);
     }
   }
 
+  @GET
+  @Path("/zk/getChildren")
+  @Produces(MediaType.APPLICATION_JSON)
+  @ApiOperation(value = "Get all child znodes")
+  @ApiResponses(value = {
+      @ApiResponse(code = 200, message = "Success"),
+      @ApiResponse(code = 404, message = "ZK Path not found"),
+      @ApiResponse(code = 204, message = "No Content"),
+      @ApiResponse(code = 500, message = "Internal server error")
+  })
+  public String getChildren(
+      @ApiParam(value = "Zookeeper Path, must start with /", required = true) 
@QueryParam("path") String path) {
+
+    path = validateAndNormalizeZKPath(path, true);
+
+    List<ZNRecord> znRecords = _pinotHelixResourceManager.getZKChildren(path);
+    if (znRecords != null) {
+      List<String> resp = new ArrayList<>();
+      for (ZNRecord znRecord : znRecords) {
+        if (znRecord != null) {
+          byte[] serializeBytes = serialize(znRecord);
+          resp.add(new String(serializeBytes, StandardCharsets.UTF_8));
+        }
+      }
+      try {
+        return JsonUtils.objectToString(resp);

Review comment:
       I think this is the current behavior of the `zk/get` return as well 
(e.g. also escaped).




-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



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

Reply via email to