You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by en...@apache.org on 2014/06/28 02:31:32 UTC

[46/49] git commit: 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.

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.


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/8e40fa0c
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/8e40fa0c
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/8e40fa0c

Branch: refs/heads/master
Commit: 8e40fa0c41ba24de2f3dad7afc77eb910c0fe7d4
Parents: e5ec49b
Author: Devaraj Das <dd...@Devaraj-Dass-MacBook-Pro-2.local>
Authored: Sat May 24 09:18:31 2014 -0700
Committer: Enis Soztutar <en...@apache.org>
Committed: Fri Jun 27 16:39:40 2014 -0700

----------------------------------------------------------------------
 .../hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java   | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/8e40fa0c/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java
----------------------------------------------------------------------
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 4112014..fa02f3c 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<RegionCoprocessorEnvironment> 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,