diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java index 4112014bd2c..fa02f3c1cfe 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java @@ -156,7 +156,7 @@ public class IntegrationTestBulkLoad extends IntegrationTestBase { @Override public RegionScanner preScannerOpen(final ObserverContext e, final Scan scan, final RegionScanner s) throws IOException { - if (countOfOpen.incrementAndGet() % 4 == 0) { //slowdown openScanner randomly + if (countOfOpen.incrementAndGet() == 2) { //slowdown openScanner randomly slowdownCode(e); } return s; @@ -168,7 +168,8 @@ public class IntegrationTestBulkLoad extends IntegrationTestBase { final int limit, final boolean hasMore) throws IOException { //this will slow down a certain next operation if the conditions are met. The slowness //will allow the call to go to a replica - if (countOfNext.incrementAndGet() % 4 == 0) { + countOfNext.incrementAndGet(); + if (countOfNext.get() == 0 || countOfNext.get() == 4) { slowdownCode(e); } return true; @@ -655,6 +656,11 @@ public class IntegrationTestBulkLoad extends IntegrationTestBase { scan.setCacheBlocks(false); scan.setBatch(1000); + int replicaCount = conf.getInt(NUM_REPLICA_COUNT_KEY, NUM_REPLICA_COUNT_DEFAULT); + if (replicaCount != NUM_REPLICA_COUNT_DEFAULT) { + scan.setConsistency(Consistency.TIMELINE); + } + TableMapReduceUtil.initTableMapperJob( Bytes.toBytes(getTablename()), scan,