From 8e40fa0c41ba24de2f3dad7afc77eb910c0fe7d4 Mon Sep 17 00:00:00 2001 From: Devaraj Das Date: Sat, 24 May 2014 09:18:31 -0700 Subject: [PATCH 42/45] HBASE-10818. Addendum to reduce the number of times sleep happens in the coprocessor. Also, puts back code to set consistency that got deleted by accident in the last commit. --- .../apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java index 4112014..fa02f3c 100644 --- hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java +++ 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, -- 2.0.0