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 f881d298d48..a696d5f97ad 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> finished = Lists.newLinkedList(); + LinkedList> 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> finished = splitScan(outstanding, table, splitAlgo); if (finished.isEmpty()) { @@ -574,7 +579,9 @@ public class RegionSplitter { for (Pair region : finished) { splitOut.writeChars("- " + splitAlgo.rowToStr(region.getFirst()) + " " + splitAlgo.rowToStr(region.getSecond()) + "\n"); + splitCount++; } + LOG.debug("Finally " + finished.size() + " outstanding splits finished"); } } }