hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject [1/3] hbase git commit: HBASE-12891 Parallel execution for Hbck checkRegionConsistency
Date Fri, 06 Feb 2015 23:14:39 GMT
Repository: hbase
Updated Branches:
  refs/heads/0.98 beab86116 -> de08a82c6
  refs/heads/branch-1 fc7f53f24 -> b14614c94
  refs/heads/master 3b56d2a0b -> eddd5739a


HBASE-12891 Parallel execution for Hbck checkRegionConsistency

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/eddd5739
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/eddd5739
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/eddd5739

Branch: refs/heads/master
Commit: eddd5739a14ceb5cfc9b9c7d2e357eea96bd9703
Parents: 3b56d2a
Author: rahulgidwani <rahul.gidwani@flurry.com>
Authored: Fri Feb 6 15:14:18 2015 -0800
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Fri Feb 6 15:14:18 2015 -0800

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/util/HBaseFsck.java | 28 +++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/eddd5739/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
index 8e1d848..96bd0f7 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
@@ -1703,9 +1703,19 @@ public class HBaseFsck extends Configured implements Closeable {
   throws IOException, KeeperException, InterruptedException {
     // Divide the checks in two phases. One for default/primary replicas and another
     // for the non-primary ones. Keeps code cleaner this way.
+    List<WorkItemRegionConsistency> workItems =
+        new ArrayList<WorkItemRegionConsistency>(regionInfoMap.size());
     for (java.util.Map.Entry<String, HbckInfo> e: regionInfoMap.entrySet()) {
       if (e.getValue().getReplicaId() == HRegionInfo.DEFAULT_REPLICA_ID) {
-        checkRegionConsistency(e.getKey(), e.getValue());
+        workItems.add(new WorkItemRegionConsistency(e.getKey(), e.getValue()));
+      }
+    }
+    List<Future<Void>> workFutures = executor.invokeAll(workItems);
+    for(Future<Void> f: workFutures) {
+      try {
+        f.get();
+      } catch(ExecutionException e1) {
+        LOG.warn("Could not check region consistency " , e1.getCause());
       }
     }
     boolean prevHdfsCheck = shouldCheckHdfs();
@@ -2355,6 +2365,22 @@ public class HBaseFsck extends Configured implements Closeable {
     }
   };
 
+  class WorkItemRegionConsistency implements Callable<Void> {
+    private final String key;
+    private final HbckInfo hbi;
+
+    WorkItemRegionConsistency(String key, HbckInfo hbi) {
+      this.key = key;
+      this.hbi = hbi;
+    }
+
+    @Override
+    public synchronized Void call() throws Exception {
+      checkRegionConsistency(key, hbi);
+      return null;
+    }
+  }
+
 
   /**
    * Maintain information about a particular table.


Mime
View raw message