[ https://issues.apache.org/jira/browse/HDFS-17029?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17727804#comment-17727804 ]
ASF GitHub Bot commented on HDFS-17029: --------------------------------------- slfan1989 commented on code in PR #5698: URL: https://github.com/apache/hadoop/pull/5698#discussion_r1211125291 ########## hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/JsonUtil.java: ########## @@ -741,4 +741,27 @@ public static Map<String, Object> toJsonMap(FsStatus status) { m.put("remaining", status.getRemaining()); return m; } + + public static Map<String, Object> toJsonMap(ErasureCodingPolicyInfo ecPolicyInfo) { + if (ecPolicyInfo == null) { + return null; + } + Map<String, Object> m = new HashMap<>(); + m.put("policy", ecPolicyInfo.getPolicy()); + m.put("state", ecPolicyInfo.getState()); + return m; + } + + public static String toJsonString(ErasureCodingPolicyInfo[] ecPolicyInfos) { + final Map<String, Object> erasureCodingPolicies = new TreeMap<>(); Review Comment: Why TreeMap? > Support getECPolices API in WebHDFS > ----------------------------------- > > Key: HDFS-17029 > URL: https://issues.apache.org/jira/browse/HDFS-17029 > Project: Hadoop HDFS > Issue Type: Improvement > Components: webhdfs > Affects Versions: 3.4.0 > Reporter: Hualong Zhang > Assignee: Hualong Zhang > Priority: Major > Labels: pull-request-available > Attachments: image-2023-05-29-23-55-09-224.png > > > WebHDFS should support getEcPolicies: > !image-2023-05-29-23-55-09-224.png|width=817,height=234! -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org