You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ap...@apache.org on 2014/03/16 00:22:13 UTC

svn commit: r1577950 - /hbase/branches/0.98/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestLoadIncrementalHFilesSplitRecovery.java

Author: apurtell
Date: Sat Mar 15 23:22:12 2014
New Revision: 1577950

URL: http://svn.apache.org/r1577950
Log:
HBASE-10764 TestLoadIncrementalHFilesSplitRecovery#testBulkLoadPhaseFailure takes too long (rajeshbabu)

Modified:
    hbase/branches/0.98/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestLoadIncrementalHFilesSplitRecovery.java

Modified: hbase/branches/0.98/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestLoadIncrementalHFilesSplitRecovery.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.98/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestLoadIncrementalHFilesSplitRecovery.java?rev=1577950&r1=1577949&r2=1577950&view=diff
==============================================================================
--- hbase/branches/0.98/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestLoadIncrementalHFilesSplitRecovery.java (original)
+++ hbase/branches/0.98/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestLoadIncrementalHFilesSplitRecovery.java Sat Mar 15 23:22:12 2014
@@ -262,33 +262,38 @@ public class TestLoadIncrementalHFilesSp
 
     final AtomicInteger attmptedCalls = new AtomicInteger();
     final AtomicInteger failedCalls = new AtomicInteger();
-    LoadIncrementalHFiles lih = new LoadIncrementalHFiles(
-        util.getConfiguration()) {
+    util.getConfiguration().setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 2);
+    try {
+      LoadIncrementalHFiles lih = new LoadIncrementalHFiles(util.getConfiguration()) {
 
-      protected List<LoadQueueItem> tryAtomicRegionLoad(final HConnection conn,
-          TableName tableName, final byte[] first, Collection<LoadQueueItem> lqis)
-      throws IOException {
-        int i = attmptedCalls.incrementAndGet();
-        if (i == 1) {
-          HConnection errConn = null;
-          try {
-            errConn = getMockedConnection(util.getConfiguration());
-          } catch (Exception e) {
-            LOG.fatal("mocking cruft, should never happen", e);
-            throw new RuntimeException("mocking cruft, should never happen");
+        protected List<LoadQueueItem> tryAtomicRegionLoad(final HConnection conn,
+            TableName tableName, final byte[] first, Collection<LoadQueueItem> lqis)
+            throws IOException {
+          int i = attmptedCalls.incrementAndGet();
+          if (i == 1) {
+            HConnection errConn = null;
+            try {
+              errConn = getMockedConnection(util.getConfiguration());
+            } catch (Exception e) {
+              LOG.fatal("mocking cruft, should never happen", e);
+              throw new RuntimeException("mocking cruft, should never happen");
+            }
+            failedCalls.incrementAndGet();
+            return super.tryAtomicRegionLoad(errConn, tableName, first, lqis);
           }
-          failedCalls.incrementAndGet();
-          return super.tryAtomicRegionLoad(errConn, tableName, first, lqis);
-        }
 
-        return super.tryAtomicRegionLoad(conn, tableName, first, lqis);
-      }
-    };
+          return super.tryAtomicRegionLoad(conn, tableName, first, lqis);
+        }
+      };
 
-    // create HFiles for different column families
-    Path dir = buildBulkFiles(table, 1);
-    HTable t = new HTable(util.getConfiguration(), Bytes.toBytes(table));
-    lih.doBulkLoad(dir, t);
+      // create HFiles for different column families
+      Path dir = buildBulkFiles(table, 1);
+      HTable t = new HTable(util.getConfiguration(), Bytes.toBytes(table));
+      lih.doBulkLoad(dir, t);
+    } finally {
+      util.getConfiguration().setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER,
+        HConstants.DEFAULT_HBASE_CLIENT_RETRIES_NUMBER);
+    }
 
     fail("doBulkLoad should have thrown an exception");
   }
@@ -433,9 +438,9 @@ public class TestLoadIncrementalHFilesSp
   public void testGroupOrSplitWhenRegionHoleExistsInMeta() throws Exception {
     String tableName = "testGroupOrSplitWhenRegionHoleExistsInMeta";
     byte[][] SPLIT_KEYS = new byte[][] { Bytes.toBytes("row_00000100") };
+    HTable table = new HTable(util.getConfiguration(), Bytes.toBytes(tableName));
 
     setupTableWithSplitkeys(tableName, 10, SPLIT_KEYS);
-    HTable table = new HTable(util.getConfiguration(), Bytes.toBytes(tableName));
     Path dir = buildBulkFiles(tableName, 2);
 
     final AtomicInteger countedLqis = new AtomicInteger();