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

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

steveloughran commented on code in PR #6555:
URL: https://github.com/apache/hadoop/pull/6555#discussion_r1492392990


##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/ContentTypes.java:
##########
@@ -0,0 +1,33 @@
+/**
+ * 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.http;
+
+/**
+ * Content Types for HTTP.
+ *
+ * @since 3.5.0
+ */
+public class ContentTypes {

Review Comment:
   final?



##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/ContentTypes.java:
##########
@@ -0,0 +1,33 @@
+/**
+ * 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.http;
+
+/**
+ * Content Types for HTTP.
+ *
+ * @since 3.5.0

Review Comment:
   cut so it's easier to backport



##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineReaderClientImpl.java:
##########
@@ -19,6 +19,7 @@
 
 import org.apache.hadoop.classification.VisibleForTesting;
 import com.sun.jersey.core.util.MultivaluedMapImpl;
+import org.apache.hadoop.http.ContentTypes;

Review Comment:
   nit: import placement



##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineWriter.java:
##########
@@ -24,8 +24,8 @@
 import java.lang.reflect.UndeclaredThrowableException;
 import java.net.URI;
 import java.security.PrivilegedExceptionAction;
-import javax.ws.rs.core.MediaType;
 
+import org.apache.hadoop.http.ContentTypes;

Review Comment:
   nit: import placement



##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/resources/ExceptionHandler.java:
##########
@@ -22,11 +22,11 @@
 
 import javax.servlet.http.HttpServletResponse;
 import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.ext.ExceptionMapper;
 import javax.ws.rs.ext.Provider;
 
+import org.apache.hadoop.http.ContentTypes;

Review Comment:
   nit: import placement



##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineV2ClientImpl.java:
##########
@@ -34,9 +34,9 @@
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.CancellationException;
 
-import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;

Review Comment:
   presumably we will want to cut this too, in future...



##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/timeline/webapp/TestTimelineWebServices.java:
##########
@@ -39,6 +38,7 @@
 import com.sun.jersey.api.client.config.DefaultClientConfig;
 import com.sun.jersey.guice.spi.container.servlet.GuiceContainer;
 import com.sun.jersey.test.framework.WebAppDescriptor;
+import org.apache.hadoop.http.ContentTypes;

Review Comment:
   nit: import placement



##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineV2ClientImpl.java:
##########
@@ -34,9 +34,9 @@
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.CancellationException;
 
-import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;
 
+import org.apache.hadoop.http.ContentTypes;

Review Comment:
   nit: import placement



##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/TestAHSWebServices.java:
##########
@@ -41,6 +40,7 @@
 import com.sun.jersey.api.client.WebResource;
 import com.sun.jersey.guice.spi.container.servlet.GuiceContainer;
 import com.sun.jersey.test.framework.WebAppDescriptor;
+import org.apache.hadoop.http.ContentTypes;

Review Comment:
   nit: import placement



##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/test/java/org/apache/hadoop/yarn/server/timelineservice/reader/TestTimelineReaderWebServicesACL.java:
##########
@@ -33,6 +32,7 @@
 import com.sun.jersey.api.client.config.DefaultClientConfig;
 import com.sun.jersey.client.urlconnection.HttpURLConnectionFactory;
 import com.sun.jersey.client.urlconnection.URLConnectionClientHandler;
+import org.apache.hadoop.http.ContentTypes;

Review Comment:
   nit: import placement





> reduce use of javax.ws.rs.core.MediaType
> ----------------------------------------
>
>                 Key: HADOOP-19078
>                 URL: https://issues.apache.org/jira/browse/HADOOP-19078
>             Project: Hadoop Common
>          Issue Type: Task
>            Reporter: PJ Fanning
>            Priority: Major
>              Labels: pull-request-available
>
> makes it easier to support jersey 1 and 2



--
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