Index: hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestLoadIncrementalHFilesSplitRecovery.java =================================================================== --- hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestLoadIncrementalHFilesSplitRecovery.java (revision 1577809) +++ hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestLoadIncrementalHFilesSplitRecovery.java (working copy) @@ -262,37 +262,41 @@ 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 tryAtomicRegionLoad(final HConnection conn, - TableName tableName, final byte[] first, Collection 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 tryAtomicRegionLoad(final HConnection conn, + TableName tableName, final byte[] first, Collection 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); + } finally { + util.getConfiguration().setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, + HConstants.DEFAULT_HBASE_CLIENT_RETRIES_NUMBER); + } - // create HFiles for different column families - Path dir = buildBulkFiles(table, 1); - HTable t = new HTable(util.getConfiguration(), Bytes.toBytes(table)); - lih.doBulkLoad(dir, t); + fail("doBulkLoad should have thrown an exception");} - fail("doBulkLoad should have thrown an exception"); - } - private HConnection getMockedConnection(final Configuration conf) throws IOException, ServiceException { HConnection c = Mockito.mock(HConnection.class); @@ -433,9 +437,9 @@ 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();