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

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

pjfanning commented on PR #8654:
URL: https://github.com/apache/hadoop/pull/8654#issuecomment-5342462202

   > Small observation in `RBFMetrics.getJson` (`RBFMetrics.java:1002`): null 
fields are stored as `JSONObject.NULL`. With the old Jetty `JSON.toString`, 
that rendered as the string `"null"` (Jetty falls back to `toString()` for 
unknown POJOs). With Jackson it becomes `{"explicitNull":false}` (jettison 
1.5.4's `Null` exposes a public `explicitNull` field), so null fields switch 
from string to object in `getMountTable()` / `getNamenodes()` / `getRouters()`.
   > 
   > It's an observable JMX-output change for those attributes. If 
`JSONObject.NULL` was only there for the jettison path, plain `null` in 
`getJson` would keep the field as JSON `null`.
   
   @pan3793 this definitely needs to be fixed. I was looking at changing 
JsonUtils class to add an explicit serializer for JSONObject.NULL to output a 
JSON null but hadoop-commons doesn't have Jettison as a dependency.
   I think it might be easier to stop using JSONObject.NULL in RBFMetrics. The 
easiest is to just not add the entry to the map instead of adding it with a 
value of JSONObject.NULL.
   If we need to have it output with a null, I can code up something local to 
RBFMetrics. Any preferences?




> 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