[
https://issues.apache.org/jira/browse/HADOOP-19231?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17873639#comment-17873639
]
ASF GitHub Bot commented on HADOOP-19231:
-----------------------------------------
steveloughran commented on code in PR #6953:
URL: https://github.com/apache/hadoop/pull/6953#discussion_r1717277556
##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/JacksonUtil.java:
##########
@@ -0,0 +1,122 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.util;
+
+import com.fasterxml.jackson.core.JsonFactory;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.ObjectReader;
+import com.fasterxml.jackson.databind.ObjectWriter;
+import com.fasterxml.jackson.databind.json.JsonMapper;
+import org.apache.hadoop.classification.InterfaceAudience.Private;
Review Comment:
split into its own block
##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/RemoteSASKeyGeneratorImpl.java:
##########
@@ -29,6 +29,7 @@
import org.apache.hadoop.fs.azure.security.Constants;
import org.apache.hadoop.io.retry.RetryPolicy;
import org.apache.hadoop.io.retry.RetryUtils;
+import org.apache.hadoop.util.JacksonUtil;
Review Comment:
ordering?
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-catalog/hadoop-yarn-applications-catalog-webapp/src/main/java/org/apache/hadoop/yarn/appcatalog/application/YarnServiceClient.java:
##########
@@ -46,6 +47,19 @@
public class YarnServiceClient {
private static final Logger LOG =
LoggerFactory.getLogger(YarnServiceClient.class);
+
+ /**
+ * It is more performant to reuse ObjectMapper instances but keeping the
instance
Review Comment:
are you? never knew that.
> add JacksonUtil to centralise some code
> ---------------------------------------
>
> Key: HADOOP-19231
> URL: https://issues.apache.org/jira/browse/HADOOP-19231
> Project: Hadoop Common
> Issue Type: Task
> Reporter: PJ Fanning
> Priority: Major
> Labels: pull-request-available
>
> To future proof Hadoop against Jackson changes, it makes sense to not just
> create ObjectMappers and JsonFactories in many different places in the Hadoop
> code.
> One of the main drivers of this is
> https://www.javadoc.io/doc/com.fasterxml.jackson.core/jackson-core/latest/com/fasterxml/jackson/core/StreamReadConstraints.html
>
> Jackson 3 (not yet scheduled for release) has some fairly big API and
> behaviour changes too.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]