[
https://issues.apache.org/jira/browse/MAPREDUCE-7530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18057919#comment-18057919
]
ASF GitHub Bot commented on MAPREDUCE-7530:
-------------------------------------------
Hean-Chhinling commented on code in PR #8247:
URL: https://github.com/apache/hadoop/pull/8247#discussion_r2794292740
##########
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/jsonprovider/ExcludeRootJSONProvider.java:
##########
@@ -0,0 +1,83 @@
+/**
+ * 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.mapreduce.v2.app.webapp.jsonprovider;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import javax.inject.Inject;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.ext.Provider;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+
+import org.eclipse.persistence.jaxb.MarshallerProperties;
+import org.eclipse.persistence.jaxb.rs.MOXyJsonProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@Provider
+@Produces(MediaType.APPLICATION_JSON)
+@Consumes(MediaType.APPLICATION_JSON)
+public class ExcludeRootJSONProvider extends MOXyJsonProvider {
+
+ private final static Logger LOG =
LoggerFactory.getLogger(ExcludeRootJSONProvider.class);
+ private final ClassSerialisationConfig classSerialisationConfig;
+
+ @Inject
+ public ExcludeRootJSONProvider() {
+ classSerialisationConfig = new ClassSerialisationConfig();
+ }
+
+ @Override
+ public boolean isReadable(Class<?> type, Type genericType,
+ Annotation[] annotations, MediaType mediaType) {
+ boolean match =
classSerialisationConfig.getUnWrappedClasses().contains(type);
+ LOG.trace("ExcludeRootJSONProvider compatibility with {} is {}", type,
match);
+ return match;
+ }
+
+ @Override
+ public boolean isWriteable(Class<?> type, Type genericType,
+ Annotation[] annotations, MediaType mediaType) {
+ return isReadable(type, genericType, annotations, mediaType);
+ }
+
+ @Override
+ protected void preReadFrom(Class<Object> type, Type genericType,
+ Annotation[] annotations, MediaType mediaType,
+ MultivaluedMap<String, String> httpHeaders,
+ Unmarshaller unmarshaller) throws JAXBException {
+ LOG.trace("ExcludeRootJSONProvider preReadFrom with {}", type);
Review Comment:
Will we need these log for production as well?
Or you have not deleted it from your testing?
> MR AM REST API backward compatibility with Jersey1
> --------------------------------------------------
>
> Key: MAPREDUCE-7530
> URL: https://issues.apache.org/jira/browse/MAPREDUCE-7530
> Project: Hadoop Map/Reduce
> Issue Type: Bug
> Components: mr-am
> Affects Versions: 3.5.0
> Reporter: Bence Kosztolnik
> Priority: Major
> Labels: pull-request-available
>
> We can not get metrics for running MR job via proxy.
> Example call:
> http://\{{RM}}:8088/proxy/application_1770709887971_0014/ws/v1/mapreduce/jobs/job_1770709887971_0014/counters
> Results 404
> Seems like we have to use moxy here also
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]