zhtttylz commented on code in PR #5698:
URL: https://github.com/apache/hadoop/pull/5698#discussion_r1211341558
##########
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:
Thank you for your valuable suggestion. Since sorting of keys is not
required, it's unnecessary to use `TreeMap`. I sincerely appreciate it and
will promptly implement the required adjustments to the code!
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]