hadoop git commit: HDFS-9905. WebHdfsFileSystem#runWithRetry should display original stack trace on error. (Wei-Chiu Chuang via iwasakims)

2016-06-09 Thread epayne
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.7 577466c1f -> 5a3fed060


HDFS-9905. WebHdfsFileSystem#runWithRetry should display original stack trace 
on error. (Wei-Chiu Chuang via iwasakims)

cherry-picked from 6fcde2e38da04cae3aad6b13cf442af211f71506


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

Branch: refs/heads/branch-2.7
Commit: 5a3fed060264596ecdce294b33770faa4d4b51b0
Parents: 577466c
Author: Masatake Iwasaki 
Authored: Sat Apr 23 23:37:56 2016 +0900
Committer: Eric Payne 
Committed: Thu Jun 9 20:48:58 2016 +

--
 .../hadoop/hdfs/web/WebHdfsFileSystem.java  |  6 +++--
 .../hadoop/hdfs/web/TestWebHdfsTimeouts.java| 25 +---
 2 files changed, 20 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hadoop/blob/5a3fed06/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
--
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
index a72fa27..ccfed0b 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
@@ -641,8 +641,10 @@ public class WebHdfsFileSystem extends FileSystem
 node = url.getAuthority();
   }
   try {
-  ioe = ioe.getClass().getConstructor(String.class)
-.newInstance(node + ": " + ioe.getMessage());
+IOException newIoe = ioe.getClass().getConstructor(String.class)
+.newInstance(node + ": " + ioe.getMessage());
+newIoe.setStackTrace(ioe.getStackTrace());
+ioe = newIoe;
   } catch (NoSuchMethodException | SecurityException 
| InstantiationException | IllegalAccessException
| IllegalArgumentException | InvocationTargetException e) {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/5a3fed06/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTimeouts.java
--
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTimeouts.java
 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTimeouts.java
index 5419093..ee97d73 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTimeouts.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTimeouts.java
@@ -18,7 +18,6 @@
 
 package org.apache.hadoop.hdfs.web;
 
-import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
 import java.io.BufferedReader;
@@ -43,6 +42,7 @@ import org.apache.hadoop.hdfs.DFSConfigKeys;
 import org.apache.hadoop.io.IOUtils;
 import org.apache.hadoop.net.NetUtils;
 import org.apache.hadoop.security.authentication.client.ConnectionConfigurator;
+import org.apache.hadoop.test.GenericTestUtils;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -115,7 +115,8 @@ public class TestWebHdfsTimeouts {
   fs.listFiles(new Path("/"), false);
   fail("expected timeout");
 } catch (SocketTimeoutException e) {
-  assertEquals(fs.getUri().getAuthority() + ": connect timed out", 
e.getMessage());
+  GenericTestUtils.assertExceptionContains(fs.getUri().getAuthority()
+  + ": connect timed out",e);
 }
   }
 
@@ -128,7 +129,8 @@ public class TestWebHdfsTimeouts {
   fs.listFiles(new Path("/"), false);
   fail("expected timeout");
 } catch (SocketTimeoutException e) {
-  assertEquals(fs.getUri().getAuthority() + ": Read timed out", 
e.getMessage());
+  GenericTestUtils.assertExceptionContains(fs.getUri().getAuthority() +
+  ": Read timed out", e);
 }
   }
 
@@ -143,7 +145,8 @@ public class TestWebHdfsTimeouts {
   fs.getDelegationToken("renewer");
   fail("expected timeout");
 } catch (SocketTimeoutException e) {
-  assertEquals(fs.getUri().getAuthority() + ": connect timed out", 
e.getMessage());
+  GenericTestUtils.assertExceptionContains(fs.getUri().getAuthority() +
+  ": connect timed out", e);
 }
   }
 
@@ -157,7 +160,8 @@ public class TestWebHdfsTimeouts {
   fs.getDelegationToken("renewer");
   

[18/50] hadoop git commit: HDFS-9905. WebHdfsFileSystem#runWithRetry should display original stack trace on error. (Wei-Chiu Chuang via iwasakims)

2016-05-03 Thread aw
HDFS-9905. WebHdfsFileSystem#runWithRetry should display original stack trace 
on error. (Wei-Chiu Chuang via iwasakims)

(cherry picked from commit 6fcde2e38da04cae3aad6b13cf442af211f71506)


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

Branch: refs/heads/branch-2.8
Commit: c4d8090b7291d942e80685975de337060dc7d153
Parents: 358b54d
Author: Masatake Iwasaki 
Authored: Sat Apr 23 23:37:56 2016 +0900
Committer: Masatake Iwasaki 
Committed: Sat Apr 23 23:55:27 2016 +0900

--
 .../hadoop/hdfs/web/WebHdfsFileSystem.java  |  6 +++--
 .../hadoop/hdfs/web/TestWebHdfsTimeouts.java| 25 +---
 2 files changed, 20 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hadoop/blob/c4d8090b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
--
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
 
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
index 6a90be5..03b372e 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
@@ -737,8 +737,10 @@ public class WebHdfsFileSystem extends FileSystem
 node = url.getAuthority();
   }
   try {
-  ioe = ioe.getClass().getConstructor(String.class)
-.newInstance(node + ": " + ioe.getMessage());
+IOException newIoe = ioe.getClass().getConstructor(String.class)
+.newInstance(node + ": " + ioe.getMessage());
+newIoe.setStackTrace(ioe.getStackTrace());
+ioe = newIoe;
   } catch (NoSuchMethodException | SecurityException 
| InstantiationException | IllegalAccessException
| IllegalArgumentException | InvocationTargetException e) {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/c4d8090b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTimeouts.java
--
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTimeouts.java
 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTimeouts.java
index 664e32d..67c39e1 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTimeouts.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTimeouts.java
@@ -18,7 +18,6 @@
 
 package org.apache.hadoop.hdfs.web;
 
-import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
 import java.io.BufferedReader;
@@ -46,6 +45,7 @@ import org.apache.hadoop.hdfs.DFSConfigKeys;
 import org.apache.hadoop.io.IOUtils;
 import org.apache.hadoop.net.NetUtils;
 import org.apache.hadoop.security.authentication.client.ConnectionConfigurator;
+import org.apache.hadoop.test.GenericTestUtils;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.runner.RunWith;
@@ -150,7 +150,8 @@ public class TestWebHdfsTimeouts {
   fs.listFiles(new Path("/"), false);
   fail("expected timeout");
 } catch (SocketTimeoutException e) {
-  assertEquals(fs.getUri().getAuthority() + ": connect timed out", 
e.getMessage());
+  GenericTestUtils.assertExceptionContains(fs.getUri().getAuthority()
+  + ": connect timed out",e);
 }
   }
 
@@ -163,7 +164,8 @@ public class TestWebHdfsTimeouts {
   fs.listFiles(new Path("/"), false);
   fail("expected timeout");
 } catch (SocketTimeoutException e) {
-  assertEquals(fs.getUri().getAuthority() + ": Read timed out", 
e.getMessage());
+  GenericTestUtils.assertExceptionContains(fs.getUri().getAuthority() +
+  ": Read timed out", e);
 }
   }
 
@@ -178,7 +180,8 @@ public class TestWebHdfsTimeouts {
   fs.getDelegationToken("renewer");
   fail("expected timeout");
 } catch (SocketTimeoutException e) {
-  assertEquals(fs.getUri().getAuthority() + ": connect timed out", 
e.getMessage());
+  GenericTestUtils.assertExceptionContains(fs.getUri().getAuthority() +
+  ": connect timed out", e);
 }
   }
 
@@ -192,7 +195,8 @@ public class TestWebHdfsTimeouts {
   fs.getDelegationToken("renewer");
   fail("expected timeout");
  

hadoop git commit: HDFS-9905. WebHdfsFileSystem#runWithRetry should display original stack trace on error. (Wei-Chiu Chuang via iwasakims)

2016-04-23 Thread iwasakims
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.8 358b54d06 -> c4d8090b7


HDFS-9905. WebHdfsFileSystem#runWithRetry should display original stack trace 
on error. (Wei-Chiu Chuang via iwasakims)

(cherry picked from commit 6fcde2e38da04cae3aad6b13cf442af211f71506)


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

Branch: refs/heads/branch-2.8
Commit: c4d8090b7291d942e80685975de337060dc7d153
Parents: 358b54d
Author: Masatake Iwasaki 
Authored: Sat Apr 23 23:37:56 2016 +0900
Committer: Masatake Iwasaki 
Committed: Sat Apr 23 23:55:27 2016 +0900

--
 .../hadoop/hdfs/web/WebHdfsFileSystem.java  |  6 +++--
 .../hadoop/hdfs/web/TestWebHdfsTimeouts.java| 25 +---
 2 files changed, 20 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hadoop/blob/c4d8090b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
--
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
 
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
index 6a90be5..03b372e 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
@@ -737,8 +737,10 @@ public class WebHdfsFileSystem extends FileSystem
 node = url.getAuthority();
   }
   try {
-  ioe = ioe.getClass().getConstructor(String.class)
-.newInstance(node + ": " + ioe.getMessage());
+IOException newIoe = ioe.getClass().getConstructor(String.class)
+.newInstance(node + ": " + ioe.getMessage());
+newIoe.setStackTrace(ioe.getStackTrace());
+ioe = newIoe;
   } catch (NoSuchMethodException | SecurityException 
| InstantiationException | IllegalAccessException
| IllegalArgumentException | InvocationTargetException e) {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/c4d8090b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTimeouts.java
--
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTimeouts.java
 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTimeouts.java
index 664e32d..67c39e1 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTimeouts.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTimeouts.java
@@ -18,7 +18,6 @@
 
 package org.apache.hadoop.hdfs.web;
 
-import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
 import java.io.BufferedReader;
@@ -46,6 +45,7 @@ import org.apache.hadoop.hdfs.DFSConfigKeys;
 import org.apache.hadoop.io.IOUtils;
 import org.apache.hadoop.net.NetUtils;
 import org.apache.hadoop.security.authentication.client.ConnectionConfigurator;
+import org.apache.hadoop.test.GenericTestUtils;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.runner.RunWith;
@@ -150,7 +150,8 @@ public class TestWebHdfsTimeouts {
   fs.listFiles(new Path("/"), false);
   fail("expected timeout");
 } catch (SocketTimeoutException e) {
-  assertEquals(fs.getUri().getAuthority() + ": connect timed out", 
e.getMessage());
+  GenericTestUtils.assertExceptionContains(fs.getUri().getAuthority()
+  + ": connect timed out",e);
 }
   }
 
@@ -163,7 +164,8 @@ public class TestWebHdfsTimeouts {
   fs.listFiles(new Path("/"), false);
   fail("expected timeout");
 } catch (SocketTimeoutException e) {
-  assertEquals(fs.getUri().getAuthority() + ": Read timed out", 
e.getMessage());
+  GenericTestUtils.assertExceptionContains(fs.getUri().getAuthority() +
+  ": Read timed out", e);
 }
   }
 
@@ -178,7 +180,8 @@ public class TestWebHdfsTimeouts {
   fs.getDelegationToken("renewer");
   fail("expected timeout");
 } catch (SocketTimeoutException e) {
-  assertEquals(fs.getUri().getAuthority() + ": connect timed out", 
e.getMessage());
+  GenericTestUtils.assertExceptionContains(fs.getUri().getAuthority() +
+  ": connect timed out", e);
 }
   }
 
@@ -192,7 +195,8 @@ public class 

hadoop git commit: HDFS-9905. WebHdfsFileSystem#runWithRetry should display original stack trace on error. (Wei-Chiu Chuang via iwasakims)

2016-04-23 Thread iwasakims
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 594943601 -> 96111caca


HDFS-9905. WebHdfsFileSystem#runWithRetry should display original stack trace 
on error. (Wei-Chiu Chuang via iwasakims)

(cherry picked from commit 6fcde2e38da04cae3aad6b13cf442af211f71506)


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

Branch: refs/heads/branch-2
Commit: 96111caca99dc5d73fb22804957796eae9ffed8c
Parents: 5949436
Author: Masatake Iwasaki 
Authored: Sat Apr 23 23:37:56 2016 +0900
Committer: Masatake Iwasaki 
Committed: Sat Apr 23 23:50:01 2016 +0900

--
 .../hadoop/hdfs/web/WebHdfsFileSystem.java  |  6 +++--
 .../hadoop/hdfs/web/TestWebHdfsTimeouts.java| 25 +---
 2 files changed, 20 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hadoop/blob/96111cac/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
--
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
 
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
index 6a90be5..03b372e 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
@@ -737,8 +737,10 @@ public class WebHdfsFileSystem extends FileSystem
 node = url.getAuthority();
   }
   try {
-  ioe = ioe.getClass().getConstructor(String.class)
-.newInstance(node + ": " + ioe.getMessage());
+IOException newIoe = ioe.getClass().getConstructor(String.class)
+.newInstance(node + ": " + ioe.getMessage());
+newIoe.setStackTrace(ioe.getStackTrace());
+ioe = newIoe;
   } catch (NoSuchMethodException | SecurityException 
| InstantiationException | IllegalAccessException
| IllegalArgumentException | InvocationTargetException e) {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/96111cac/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTimeouts.java
--
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTimeouts.java
 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTimeouts.java
index 664e32d..67c39e1 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTimeouts.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTimeouts.java
@@ -18,7 +18,6 @@
 
 package org.apache.hadoop.hdfs.web;
 
-import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
 import java.io.BufferedReader;
@@ -46,6 +45,7 @@ import org.apache.hadoop.hdfs.DFSConfigKeys;
 import org.apache.hadoop.io.IOUtils;
 import org.apache.hadoop.net.NetUtils;
 import org.apache.hadoop.security.authentication.client.ConnectionConfigurator;
+import org.apache.hadoop.test.GenericTestUtils;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.runner.RunWith;
@@ -150,7 +150,8 @@ public class TestWebHdfsTimeouts {
   fs.listFiles(new Path("/"), false);
   fail("expected timeout");
 } catch (SocketTimeoutException e) {
-  assertEquals(fs.getUri().getAuthority() + ": connect timed out", 
e.getMessage());
+  GenericTestUtils.assertExceptionContains(fs.getUri().getAuthority()
+  + ": connect timed out",e);
 }
   }
 
@@ -163,7 +164,8 @@ public class TestWebHdfsTimeouts {
   fs.listFiles(new Path("/"), false);
   fail("expected timeout");
 } catch (SocketTimeoutException e) {
-  assertEquals(fs.getUri().getAuthority() + ": Read timed out", 
e.getMessage());
+  GenericTestUtils.assertExceptionContains(fs.getUri().getAuthority() +
+  ": Read timed out", e);
 }
   }
 
@@ -178,7 +180,8 @@ public class TestWebHdfsTimeouts {
   fs.getDelegationToken("renewer");
   fail("expected timeout");
 } catch (SocketTimeoutException e) {
-  assertEquals(fs.getUri().getAuthority() + ": connect timed out", 
e.getMessage());
+  GenericTestUtils.assertExceptionContains(fs.getUri().getAuthority() +
+  ": connect timed out", e);
 }
   }
 
@@ -192,7 +195,8 @@ public class 

hadoop git commit: HDFS-9905. WebHdfsFileSystem#runWithRetry should display original stack trace on error. (Wei-Chiu Chuang via iwasakims)

2016-04-23 Thread iwasakims
Repository: hadoop
Updated Branches:
  refs/heads/trunk b2a654c5e -> 6fcde2e38


HDFS-9905. WebHdfsFileSystem#runWithRetry should display original stack trace 
on error. (Wei-Chiu Chuang via iwasakims)


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

Branch: refs/heads/trunk
Commit: 6fcde2e38da04cae3aad6b13cf442af211f71506
Parents: b2a654c
Author: Masatake Iwasaki 
Authored: Sat Apr 23 23:37:56 2016 +0900
Committer: Masatake Iwasaki 
Committed: Sat Apr 23 23:37:56 2016 +0900

--
 .../hadoop/hdfs/web/WebHdfsFileSystem.java  |  6 +++--
 .../hadoop/hdfs/web/TestWebHdfsTimeouts.java| 25 +---
 2 files changed, 20 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hadoop/blob/6fcde2e3/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
--
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
 
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
index 3527c27..ab4e0d0 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
@@ -730,8 +730,10 @@ public class WebHdfsFileSystem extends FileSystem
 node = url.getAuthority();
   }
   try {
-  ioe = ioe.getClass().getConstructor(String.class)
-.newInstance(node + ": " + ioe.getMessage());
+IOException newIoe = ioe.getClass().getConstructor(String.class)
+.newInstance(node + ": " + ioe.getMessage());
+newIoe.setStackTrace(ioe.getStackTrace());
+ioe = newIoe;
   } catch (NoSuchMethodException | SecurityException 
| InstantiationException | IllegalAccessException
| IllegalArgumentException | InvocationTargetException e) {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/6fcde2e3/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTimeouts.java
--
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTimeouts.java
 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTimeouts.java
index 664e32d..67c39e1 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTimeouts.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsTimeouts.java
@@ -18,7 +18,6 @@
 
 package org.apache.hadoop.hdfs.web;
 
-import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
 import java.io.BufferedReader;
@@ -46,6 +45,7 @@ import org.apache.hadoop.hdfs.DFSConfigKeys;
 import org.apache.hadoop.io.IOUtils;
 import org.apache.hadoop.net.NetUtils;
 import org.apache.hadoop.security.authentication.client.ConnectionConfigurator;
+import org.apache.hadoop.test.GenericTestUtils;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.runner.RunWith;
@@ -150,7 +150,8 @@ public class TestWebHdfsTimeouts {
   fs.listFiles(new Path("/"), false);
   fail("expected timeout");
 } catch (SocketTimeoutException e) {
-  assertEquals(fs.getUri().getAuthority() + ": connect timed out", 
e.getMessage());
+  GenericTestUtils.assertExceptionContains(fs.getUri().getAuthority()
+  + ": connect timed out",e);
 }
   }
 
@@ -163,7 +164,8 @@ public class TestWebHdfsTimeouts {
   fs.listFiles(new Path("/"), false);
   fail("expected timeout");
 } catch (SocketTimeoutException e) {
-  assertEquals(fs.getUri().getAuthority() + ": Read timed out", 
e.getMessage());
+  GenericTestUtils.assertExceptionContains(fs.getUri().getAuthority() +
+  ": Read timed out", e);
 }
   }
 
@@ -178,7 +180,8 @@ public class TestWebHdfsTimeouts {
   fs.getDelegationToken("renewer");
   fail("expected timeout");
 } catch (SocketTimeoutException e) {
-  assertEquals(fs.getUri().getAuthority() + ": connect timed out", 
e.getMessage());
+  GenericTestUtils.assertExceptionContains(fs.getUri().getAuthority() +
+  ": connect timed out", e);
 }
   }
 
@@ -192,7 +195,8 @@ public class TestWebHdfsTimeouts {
   fs.getDelegationToken("renewer");
   fail("expected