hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nkey...@apache.org
Subject svn commit: r1434057 - in /hbase/trunk/hbase-server/src: main/java/org/apache/hadoop/hbase/client/RetriesExhaustedException.java test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
Date Wed, 16 Jan 2013 17:27:42 GMT
Author: nkeywal
Date: Wed Jan 16 17:27:42 2013
New Revision: 1434057

URL: http://svn.apache.org/viewvc?rev=1434057&view=rev
Log:
HBASE-7581 TestAccessController depends on the execution order

Modified:
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/client/RetriesExhaustedException.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/client/RetriesExhaustedException.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/client/RetriesExhaustedException.java?rev=1434057&r1=1434056&r2=1434057&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/client/RetriesExhaustedException.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/client/RetriesExhaustedException.java
Wed Jan 16 17:27:42 2013
@@ -77,8 +77,10 @@ public class RetriesExhaustedException e
    * @param exceptions List of exceptions that failed before giving up
    */
   public RetriesExhaustedException(final int numTries,
-      final List<ThrowableWithExtraContext> exceptions) {
-    super(getMessage(numTries, exceptions));
+                                   final List<ThrowableWithExtraContext> exceptions)
{
+    super(getMessage(numTries, exceptions),
+        (exceptions != null && !exceptions.isEmpty() ?
+            exceptions.get(exceptions.size() - 1).t : null));
   }
 
   private static String getMessage(String callableVitals, int numTries,

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java?rev=1434057&r1=1434056&r2=1434057&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
Wed Jan 16 17:27:42 2013
@@ -675,10 +675,9 @@ public class TestAccessController {
     // action for checkAndPut()
     PrivilegedExceptionAction checkAndPut = new PrivilegedExceptionAction() {
       public Object run() throws Exception {
+        HTable t = new HTable(conf, TEST_TABLE);
         Put p = new Put(Bytes.toBytes("random_row"));
         p.add(TEST_FAMILY, Bytes.toBytes("Qualifier"), Bytes.toBytes(1));
-
-        HTable t = new HTable(conf, TEST_TABLE);
         t.checkAndPut(Bytes.toBytes("random_row"), TEST_FAMILY, Bytes.toBytes("q"),
           Bytes.toBytes("test_value"), p);
         return null;
@@ -711,6 +710,10 @@ public class TestAccessController {
       }
     };
     verifyWrite(bulkLoadAction);
+
+    // Reinit after the bulk upload
+    TEST_UTIL.getHBaseAdmin().disableTable(TEST_TABLE);
+    TEST_UTIL.getHBaseAdmin().enableTable(TEST_TABLE);
   }
 
   public class BulkLoadHelper {



Mime
View raw message