hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aajis...@apache.org
Subject hadoop git commit: MAPREDUCE-6264. Remove httpclient dependency from hadoop-mapreduce-client. Contributed by Brahma Reddy Battula.
Date Tue, 24 Feb 2015 19:36:40 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 834642792 -> 5e686dae4


MAPREDUCE-6264. Remove httpclient dependency from hadoop-mapreduce-client. Contributed by
Brahma Reddy Battula.

(cherry picked from commit 3f665aa4d5ac2e737e29ff63b3837c083a49ea80)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/5e686dae
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/5e686dae
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/5e686dae

Branch: refs/heads/branch-2
Commit: 5e686dae44381a0c9a4178ba53bf8befca52fa91
Parents: 8346427
Author: Akira Ajisaka <aajisaka@apache.org>
Authored: Tue Feb 24 11:32:11 2015 -0800
Committer: Akira Ajisaka <aajisaka@apache.org>
Committed: Tue Feb 24 11:33:05 2015 -0800

----------------------------------------------------------------------
 hadoop-mapreduce-project/CHANGES.txt            |  3 +++
 .../mapreduce/v2/app/webapp/TestAMWebApp.java   |  2 +-
 .../apache/hadoop/mapred/JobEndNotifier.java    | 27 ++++++++++----------
 3 files changed, 18 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/5e686dae/hadoop-mapreduce-project/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt
index da119f6..f56f2b9 100644
--- a/hadoop-mapreduce-project/CHANGES.txt
+++ b/hadoop-mapreduce-project/CHANGES.txt
@@ -63,6 +63,9 @@ Release 2.7.0 - UNRELEASED
     MAPREDUCE-6225. Fix new findbug warnings in hadoop-mapreduce-client-core. 
     (Varun Saxena via junping_du)
 
+    MAPREDUCE-6264. Remove httpclient dependency from hadoop-mapreduce-client.
+    (Brahma Reddy Battula via aajisaka)
+
   OPTIMIZATIONS
 
     MAPREDUCE-6169. MergeQueue should release reference to the current item 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/5e686dae/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/webapp/TestAMWebApp.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/webapp/TestAMWebApp.java
b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/webapp/TestAMWebApp.java
index f955a35..acb31bd 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/webapp/TestAMWebApp.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/webapp/TestAMWebApp.java
@@ -33,7 +33,6 @@ import javax.net.ssl.SSLException;
 
 import org.junit.Assert;
 
-import org.apache.commons.httpclient.HttpStatus;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.http.HttpConfig.Policy;
 import org.apache.hadoop.io.IOUtils;
@@ -57,6 +56,7 @@ import org.apache.hadoop.yarn.server.webproxy.amfilter.AmFilterInitializer;
 import org.apache.hadoop.yarn.webapp.WebApps;
 import org.apache.hadoop.yarn.webapp.test.WebAppTests;
 import org.apache.hadoop.yarn.webapp.util.WebAppUtils;
+import org.apache.http.HttpStatus;
 import org.junit.Test;
 
 import com.google.common.net.HttpHeaders;

http://git-wip-us.apache.org/repos/asf/hadoop/blob/5e686dae/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobEndNotifier.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobEndNotifier.java
b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobEndNotifier.java
index 74861fe..5f03dc8 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobEndNotifier.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobEndNotifier.java
@@ -19,17 +19,19 @@
 package org.apache.hadoop.mapred;
 
 import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
 import java.util.concurrent.Delayed;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.HttpMethod;
-import org.apache.commons.httpclient.URI;
-import org.apache.commons.httpclient.methods.GetMethod;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.classification.InterfaceAudience;
 import org.apache.hadoop.classification.InterfaceStability;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.params.ClientPNames;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.http.params.CoreConnectionPNames;
 
 @InterfaceAudience.Private
 @InterfaceStability.Unstable
@@ -64,15 +66,14 @@ public class JobEndNotifier {
   }
 
   private static int httpNotification(String uri, int timeout)
-      throws IOException {
-    URI url = new URI(uri, false);
-    HttpClient httpClient = new HttpClient();
-    httpClient.getParams().setSoTimeout(timeout);
-    httpClient.getParams().setConnectionManagerTimeout(timeout);
-
-    HttpMethod method = new GetMethod(url.getEscapedURI());
-    method.setRequestHeader("Accept", "*/*");
-    return httpClient.executeMethod(method);
+      throws IOException, URISyntaxException {
+    DefaultHttpClient client = new DefaultHttpClient();
+    client.getParams()
+        .setIntParameter(CoreConnectionPNames.SO_TIMEOUT, timeout)
+        .setLongParameter(ClientPNames.CONN_MANAGER_TIMEOUT, (long) timeout);
+    HttpGet httpGet = new HttpGet(new URI(uri));
+    httpGet.setHeader("Accept", "*/*");
+    return client.execute(httpGet).getStatusLine().getStatusCode();
   }
 
   // for use by the LocalJobRunner, without using a thread&queue,


Mime
View raw message