hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject [2/9] git commit: HBASE-11708 RegionSplitter incorrectly calculates splitcount
Date Fri, 15 Aug 2014 00:49:42 GMT
HBASE-11708 RegionSplitter incorrectly calculates splitcount

when split table using the util(UniformSplit or HexStringSplit),
with "-r" option, the caculation of splitCount in funciton rollingSplit
may be wrong.

Signed-off-by: Andrew Purtell <apurtell@apache.org>


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

Branch: refs/heads/master
Commit: a15b343fbf6e8a749ab9d9b0afab7dd4a80f137a
Parents: e9fd2d5
Author: shuai.lou <louis.hust@gmail.com>
Authored: Thu Aug 14 17:51:06 2014 -0700
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Thu Aug 14 17:51:06 2014 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/util/RegionSplitter.java   | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/a15b343f/hbase-server/src/main/java/org/apache/hadoop/hbase/util/RegionSplitter.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/RegionSplitter.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/RegionSplitter.java
index f881d29..a696d5f 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/RegionSplitter.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/RegionSplitter.java
@@ -532,16 +532,20 @@ public class RegionSplitter {
           admin.split(table.getTableName(), split);
 
           LinkedList<Pair<byte[], byte[]>> finished = Lists.newLinkedList();
+          LinkedList<Pair<byte[], byte[]>> local_finished = Lists.newLinkedList();
           if (conf.getBoolean("split.verify", true)) {
             // we need to verify and rate-limit our splits
             outstanding.addLast(dr);
             // with too many outstanding splits, wait for some to finish
             while (outstanding.size() >= MAX_OUTSTANDING) {
-              finished = splitScan(outstanding, table, splitAlgo);
-              if (finished.isEmpty()) {
+              LOG.debug("Wait for outstanding splits " + outstanding.size());
+              local_finished = splitScan(outstanding, table, splitAlgo);
+              if (local_finished.isEmpty()) {
                 Thread.sleep(30 * 1000);
               } else {
-                outstanding.removeAll(finished);
+                finished.addAll(local_finished);
+                outstanding.removeAll(local_finished);
+                LOG.debug(local_finished.size() + " outstanding splits finished");
               }
             }
           } else {
@@ -565,6 +569,7 @@ public class RegionSplitter {
       }
       if (conf.getBoolean("split.verify", true)) {
         while (!outstanding.isEmpty()) {
+          LOG.debug("Finally Wait for outstanding splits " + outstanding.size());
           LinkedList<Pair<byte[], byte[]>> finished = splitScan(outstanding,
               table, splitAlgo);
           if (finished.isEmpty()) {
@@ -574,7 +579,9 @@ public class RegionSplitter {
             for (Pair<byte[], byte[]> region : finished) {
               splitOut.writeChars("- " + splitAlgo.rowToStr(region.getFirst())
                   + " " + splitAlgo.rowToStr(region.getSecond()) + "\n");
+              splitCount++;
             }
+            LOG.debug("Finally " + finished.size() + " outstanding splits finished");
           }
         }
       }


Mime
View raw message