You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2021/12/01 19:25:43 UTC

[GitHub] [helix] xyuanlu commented on a change in pull request #1917: Add rest API for take/free instance

xyuanlu commented on a change in pull request #1917:
URL: https://github.com/apache/helix/pull/1917#discussion_r760504682



##########
File path: helix-rest/src/main/java/org/apache/helix/rest/clusterMaintenanceService/MaintenanceManagementService.java
##########
@@ -412,17 +411,36 @@ private StoppableCheck performCustomInstanceCheck(String clusterId, String insta
     return instanceStoppableChecks;
   }
 
-  private Map<String, String> getCustomPayLoads(String jsonContent) throws IOException {
+  public static Map<String, String> getMapFromJsonPayload(String jsonContent) throws IOException {
     Map<String, String> result = new HashMap<>();
     if (jsonContent == null) {
       return result;
     }
+
     JsonNode jsonNode = OBJECT_MAPPER.readTree(jsonContent);
     // parsing the inputs as string key value pairs
     jsonNode.fields().forEachRemaining(kv -> result.put(kv.getKey(), kv.getValue().asText()));
     return result;
   }
 
+  public static List<String> getListFromJsonPayload(JsonNode jsonContent) throws IOException {
+    if (jsonContent == null) {
+      return new ArrayList<>();

Review comment:
       TFTR. Updated. 




-- 
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: reviews-unsubscribe@helix.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org