You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ar...@apache.org on 2016/03/29 22:08:17 UTC

[1/4] hadoop git commit: HDFS-9478. Reason for failing ipc.FairCallQueue contruction should be thrown. (Contributed by Ajith S)

Repository: hadoop
Updated Branches:
  refs/heads/branch-2 1d79b57c1 -> 759d0acdd
  refs/heads/branch-2.7 efb210cc3 -> 7f14dc329
  refs/heads/branch-2.8 026b84bf7 -> 9c4631b6f
  refs/heads/trunk f2aec4eb8 -> 46a5245db


HDFS-9478. Reason for failing ipc.FairCallQueue contruction should be thrown. (Contributed by Ajith S)


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

Branch: refs/heads/trunk
Commit: 46a5245db95f2aad199100d2886381398070124f
Parents: f2aec4e
Author: Arpit Agarwal <ar...@apache.org>
Authored: Tue Mar 29 12:08:46 2016 -0700
Committer: Arpit Agarwal <ar...@apache.org>
Committed: Tue Mar 29 12:08:46 2016 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/ipc/CallQueueManager.java | 10 ++++++++
 .../apache/hadoop/ipc/TestCallQueueManager.java | 25 ++++++++++++++++++++
 2 files changed, 35 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/46a5245d/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/CallQueueManager.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/CallQueueManager.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/CallQueueManager.java
index c10f839..2ee15d3 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/CallQueueManager.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/CallQueueManager.java
@@ -19,6 +19,7 @@
 package org.apache.hadoop.ipc;
 
 import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicReference;
@@ -70,6 +71,9 @@ public class CallQueueManager<E> {
       return ctor.newInstance(maxLen, ns, conf);
     } catch (RuntimeException e) {
       throw e;
+    } catch (InvocationTargetException e) {
+      throw new RuntimeException(theClass.getName()
+          + " could not be constructed.", e.getCause());
     } catch (Exception e) {
     }
 
@@ -79,6 +83,9 @@ public class CallQueueManager<E> {
       return ctor.newInstance(maxLen);
     } catch (RuntimeException e) {
       throw e;
+    } catch (InvocationTargetException e) {
+      throw new RuntimeException(theClass.getName()
+          + " could not be constructed.", e.getCause());
     } catch (Exception e) {
     }
 
@@ -88,6 +95,9 @@ public class CallQueueManager<E> {
       return ctor.newInstance();
     } catch (RuntimeException e) {
       throw e;
+    } catch (InvocationTargetException e) {
+      throw new RuntimeException(theClass.getName()
+          + " could not be constructed.", e.getCause());
     } catch (Exception e) {
     }
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/46a5245d/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestCallQueueManager.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestCallQueueManager.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestCallQueueManager.java
index 51a9750..4d659ac 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestCallQueueManager.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestCallQueueManager.java
@@ -19,6 +19,8 @@
 package org.apache.hadoop.ipc;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -219,4 +221,27 @@ public class TestCallQueueManager {
 
     assertEquals(totalCallsConsumed, totalCallsCreated);
   }
+
+  public static class ExceptionFakeCall {
+
+    public ExceptionFakeCall() {
+      throw new IllegalArgumentException("Exception caused by constructor.!!");
+    }
+  }
+
+  private static final Class<? extends BlockingQueue<ExceptionFakeCall>> exceptionQueueClass = CallQueueManager
+      .convertQueueClass(ExceptionFakeCall.class, ExceptionFakeCall.class);
+
+  @Test
+  public void testInvocationException() throws InterruptedException {
+    try {
+      new CallQueueManager<ExceptionFakeCall>(exceptionQueueClass, false, 10,
+          "", null);
+      fail();
+    } catch (RuntimeException re) {
+      assertTrue(re.getCause() instanceof IllegalArgumentException);
+      assertEquals("Exception caused by constructor.!!", re.getCause()
+          .getMessage());
+    }
+  }
 }
\ No newline at end of file


[4/4] hadoop git commit: HDFS-9478. Reason for failing ipc.FairCallQueue contruction should be thrown. (Contributed by Ajith S)

Posted by ar...@apache.org.
HDFS-9478. Reason for failing ipc.FairCallQueue contruction should be thrown. (Contributed by Ajith S)


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

Branch: refs/heads/branch-2.7
Commit: 7f14dc3294dba7dd658fb2814fa3a599bd9dc0b0
Parents: efb210c
Author: Arpit Agarwal <ar...@apache.org>
Authored: Tue Mar 29 13:07:31 2016 -0700
Committer: Arpit Agarwal <ar...@apache.org>
Committed: Tue Mar 29 13:07:31 2016 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/ipc/CallQueueManager.java | 10 ++++++++
 .../apache/hadoop/ipc/TestCallQueueManager.java | 24 ++++++++++++++++++++
 2 files changed, 34 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/7f14dc32/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/CallQueueManager.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/CallQueueManager.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/CallQueueManager.java
index 27949d0..0b1de93 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/CallQueueManager.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/CallQueueManager.java
@@ -19,6 +19,7 @@
 package org.apache.hadoop.ipc;
 
 import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicReference;
@@ -63,6 +64,9 @@ public class CallQueueManager<E> {
       return ctor.newInstance(maxLen, ns, conf);
     } catch (RuntimeException e) {
       throw e;
+    } catch (InvocationTargetException e) {
+      throw new RuntimeException(theClass.getName()
+          + " could not be constructed.", e.getCause());
     } catch (Exception e) {
     }
 
@@ -72,6 +76,9 @@ public class CallQueueManager<E> {
       return ctor.newInstance(maxLen);
     } catch (RuntimeException e) {
       throw e;
+    } catch (InvocationTargetException e) {
+      throw new RuntimeException(theClass.getName()
+          + " could not be constructed.", e.getCause());
     } catch (Exception e) {
     }
 
@@ -81,6 +88,9 @@ public class CallQueueManager<E> {
       return ctor.newInstance();
     } catch (RuntimeException e) {
       throw e;
+    } catch (InvocationTargetException e) {
+      throw new RuntimeException(theClass.getName()
+          + " could not be constructed.", e.getCause());
     } catch (Exception e) {
     }
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/7f14dc32/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestCallQueueManager.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestCallQueueManager.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestCallQueueManager.java
index 1b618b1..40c1305 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestCallQueueManager.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestCallQueueManager.java
@@ -19,6 +19,8 @@
 package org.apache.hadoop.ipc;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -219,4 +221,26 @@ public class TestCallQueueManager {
 
     assertEquals(totalCallsConsumed, totalCallsCreated);
   }
+
+  public static class ExceptionFakeCall {
+
+    public ExceptionFakeCall() {
+      throw new IllegalArgumentException("Exception caused by constructor.!!");
+    }
+  }
+
+  private static final Class<? extends BlockingQueue<ExceptionFakeCall>> exceptionQueueClass = CallQueueManager
+      .convertQueueClass(ExceptionFakeCall.class, ExceptionFakeCall.class);
+
+  @Test
+  public void testInvocationException() throws InterruptedException {
+    try {
+      new CallQueueManager<ExceptionFakeCall>(exceptionQueueClass, 10, "", null);
+      fail();
+    } catch (RuntimeException re) {
+      assertTrue(re.getCause() instanceof IllegalArgumentException);
+      assertEquals("Exception caused by constructor.!!", re.getCause()
+          .getMessage());
+    }
+  }
 }
\ No newline at end of file


[2/4] hadoop git commit: HDFS-9478. Reason for failing ipc.FairCallQueue contruction should be thrown. (Contributed by Ajith S)

Posted by ar...@apache.org.
HDFS-9478. Reason for failing ipc.FairCallQueue contruction should be thrown. (Contributed by Ajith S)


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

Branch: refs/heads/branch-2
Commit: 759d0acdd4d2b377cd6c6fd8a4a1ebede89b373a
Parents: 1d79b57
Author: Arpit Agarwal <ar...@apache.org>
Authored: Tue Mar 29 12:08:46 2016 -0700
Committer: Arpit Agarwal <ar...@apache.org>
Committed: Tue Mar 29 12:09:10 2016 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/ipc/CallQueueManager.java | 10 ++++++++
 .../apache/hadoop/ipc/TestCallQueueManager.java | 25 ++++++++++++++++++++
 2 files changed, 35 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/759d0acd/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/CallQueueManager.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/CallQueueManager.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/CallQueueManager.java
index c10f839..2ee15d3 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/CallQueueManager.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/CallQueueManager.java
@@ -19,6 +19,7 @@
 package org.apache.hadoop.ipc;
 
 import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicReference;
@@ -70,6 +71,9 @@ public class CallQueueManager<E> {
       return ctor.newInstance(maxLen, ns, conf);
     } catch (RuntimeException e) {
       throw e;
+    } catch (InvocationTargetException e) {
+      throw new RuntimeException(theClass.getName()
+          + " could not be constructed.", e.getCause());
     } catch (Exception e) {
     }
 
@@ -79,6 +83,9 @@ public class CallQueueManager<E> {
       return ctor.newInstance(maxLen);
     } catch (RuntimeException e) {
       throw e;
+    } catch (InvocationTargetException e) {
+      throw new RuntimeException(theClass.getName()
+          + " could not be constructed.", e.getCause());
     } catch (Exception e) {
     }
 
@@ -88,6 +95,9 @@ public class CallQueueManager<E> {
       return ctor.newInstance();
     } catch (RuntimeException e) {
       throw e;
+    } catch (InvocationTargetException e) {
+      throw new RuntimeException(theClass.getName()
+          + " could not be constructed.", e.getCause());
     } catch (Exception e) {
     }
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/759d0acd/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestCallQueueManager.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestCallQueueManager.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestCallQueueManager.java
index 51a9750..4d659ac 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestCallQueueManager.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestCallQueueManager.java
@@ -19,6 +19,8 @@
 package org.apache.hadoop.ipc;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -219,4 +221,27 @@ public class TestCallQueueManager {
 
     assertEquals(totalCallsConsumed, totalCallsCreated);
   }
+
+  public static class ExceptionFakeCall {
+
+    public ExceptionFakeCall() {
+      throw new IllegalArgumentException("Exception caused by constructor.!!");
+    }
+  }
+
+  private static final Class<? extends BlockingQueue<ExceptionFakeCall>> exceptionQueueClass = CallQueueManager
+      .convertQueueClass(ExceptionFakeCall.class, ExceptionFakeCall.class);
+
+  @Test
+  public void testInvocationException() throws InterruptedException {
+    try {
+      new CallQueueManager<ExceptionFakeCall>(exceptionQueueClass, false, 10,
+          "", null);
+      fail();
+    } catch (RuntimeException re) {
+      assertTrue(re.getCause() instanceof IllegalArgumentException);
+      assertEquals("Exception caused by constructor.!!", re.getCause()
+          .getMessage());
+    }
+  }
 }
\ No newline at end of file


[3/4] hadoop git commit: HDFS-9478. Reason for failing ipc.FairCallQueue contruction should be thrown. (Contributed by Ajith S)

Posted by ar...@apache.org.
HDFS-9478. Reason for failing ipc.FairCallQueue contruction should be thrown. (Contributed by Ajith S)


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

Branch: refs/heads/branch-2.8
Commit: 9c4631b6f15ca97ccf389da9d49bdb7cc125edfc
Parents: 026b84b
Author: Arpit Agarwal <ar...@apache.org>
Authored: Tue Mar 29 12:08:46 2016 -0700
Committer: Arpit Agarwal <ar...@apache.org>
Committed: Tue Mar 29 12:09:25 2016 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/ipc/CallQueueManager.java | 10 ++++++++
 .../apache/hadoop/ipc/TestCallQueueManager.java | 25 ++++++++++++++++++++
 2 files changed, 35 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/9c4631b6/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/CallQueueManager.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/CallQueueManager.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/CallQueueManager.java
index c10f839..2ee15d3 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/CallQueueManager.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/CallQueueManager.java
@@ -19,6 +19,7 @@
 package org.apache.hadoop.ipc;
 
 import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicReference;
@@ -70,6 +71,9 @@ public class CallQueueManager<E> {
       return ctor.newInstance(maxLen, ns, conf);
     } catch (RuntimeException e) {
       throw e;
+    } catch (InvocationTargetException e) {
+      throw new RuntimeException(theClass.getName()
+          + " could not be constructed.", e.getCause());
     } catch (Exception e) {
     }
 
@@ -79,6 +83,9 @@ public class CallQueueManager<E> {
       return ctor.newInstance(maxLen);
     } catch (RuntimeException e) {
       throw e;
+    } catch (InvocationTargetException e) {
+      throw new RuntimeException(theClass.getName()
+          + " could not be constructed.", e.getCause());
     } catch (Exception e) {
     }
 
@@ -88,6 +95,9 @@ public class CallQueueManager<E> {
       return ctor.newInstance();
     } catch (RuntimeException e) {
       throw e;
+    } catch (InvocationTargetException e) {
+      throw new RuntimeException(theClass.getName()
+          + " could not be constructed.", e.getCause());
     } catch (Exception e) {
     }
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/9c4631b6/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestCallQueueManager.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestCallQueueManager.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestCallQueueManager.java
index 51a9750..4d659ac 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestCallQueueManager.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestCallQueueManager.java
@@ -19,6 +19,8 @@
 package org.apache.hadoop.ipc;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -219,4 +221,27 @@ public class TestCallQueueManager {
 
     assertEquals(totalCallsConsumed, totalCallsCreated);
   }
+
+  public static class ExceptionFakeCall {
+
+    public ExceptionFakeCall() {
+      throw new IllegalArgumentException("Exception caused by constructor.!!");
+    }
+  }
+
+  private static final Class<? extends BlockingQueue<ExceptionFakeCall>> exceptionQueueClass = CallQueueManager
+      .convertQueueClass(ExceptionFakeCall.class, ExceptionFakeCall.class);
+
+  @Test
+  public void testInvocationException() throws InterruptedException {
+    try {
+      new CallQueueManager<ExceptionFakeCall>(exceptionQueueClass, false, 10,
+          "", null);
+      fail();
+    } catch (RuntimeException re) {
+      assertTrue(re.getCause() instanceof IllegalArgumentException);
+      assertEquals("Exception caused by constructor.!!", re.getCause()
+          .getMessage());
+    }
+  }
 }
\ No newline at end of file