[ 
https://issues.apache.org/jira/browse/HADOOP-19951?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18106113#comment-18106113
 ] 

ASF GitHub Bot commented on HADOOP-19951:
-----------------------------------------

pan3793 commented on code in PR #8654:
URL: https://github.com/apache/hadoop/pull/8654#discussion_r3818473764


##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/metrics/JSON.java:
##########
@@ -0,0 +1,284 @@
+//
+//  ========================================================================
+//  Copyright (c) 1995-2022 Mort Bay Consulting Pty Ltd and others.
+//  ------------------------------------------------------------------------
+//  All rights reserved. This program and the accompanying materials
+//  are made available under the terms of the Eclipse Public License v1.0
+//  and Apache License v2.0 which accompanies this distribution.
+//
+//      The Eclipse Public License is available at
+//      http://www.eclipse.org/legal/epl-v10.html
+//
+//      The Apache License v2.0 is available at
+//      http://www.opensource.org/licenses/apache2.0.php
+//
+//  You may elect to redistribute this code under either of these licenses.
+//  ========================================================================
+//
+
+package org.apache.hadoop.hdfs.server.federation.metrics;
+
+import java.io.IOException;
+import java.lang.reflect.Array;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * <b>Internal Use Only</b> - a cutdown copy of the JSON class from 
jetty-util-ajax 9.4.
+ * <p>
+ * JSON Generator only. Do not use this for new code. It is kept for a small 
number
+ * of legacy use cases.
+ * <p>
+ * This class provides some static methods to convert POJOs to JSON
+ * notation. The java to JSON mapping is:
+ *
+ * <pre>
+ *   String --&gt; string
+ *   Number --&gt; number
+ *   Map    --&gt; object
+ *   List   --&gt; array
+ *   Array  --&gt; array
+ *   null   --&gt; null
+ *   Boolean--&gt; boolean
+ *   Object --&gt; string (dubious!)
+ * </pre>
+ */
+public class JSON {

Review Comment:
   can we narrow it to package level? or `@Private`





> Drop use of jetty-util-ajax and use jackson instead
> ---------------------------------------------------
>
>                 Key: HADOOP-19951
>                 URL: https://issues.apache.org/jira/browse/HADOOP-19951
>             Project: Hadoop Common
>          Issue Type: Task
>            Reporter: PJ Fanning
>            Priority: Major
>              Labels: pull-request-available
>
> Hadoop uses jetty-util-ajax in a few modules to read and write JSON.
> This is a part of HADOOP-19912 that can be split out and it doesn't cause the 
> same issues with worrying about jar compatibilities - it actually simplifies 
> the build by removing a direct dependency.
> The aim here is to reduce the number of ways that Hadoop works with JSON and 
> Jackson is more commonly used in Hadoop than jetty-util-ajax.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to