From ddb6a6870db031fccfb323f375bad2cec60e817c Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Sun, 18 Sep 2011 18:00:30 +0000 Subject: [PATCH] HBASE-4375 [hbck] Add region coverage visualization to hbck git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1172310 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 2 ++ .../apache/hadoop/hbase/util/HBaseFsck.java | 22 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 14474e6c326..7f4fcfde933 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -630,6 +630,8 @@ Release 0.90.5 - Unreleased in hbck. (Jonathan Hsieh) HBASE-4384 Hard to tell what causes failure in CloseRegionHandler#getCurrentVersion (Harsh J) + HBASE-4375 [hbck] Add region coverage visualization to hbck + (Jonathan Hsieh) Release 0.90.4 - August 10, 2011 diff --git a/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java b/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java index 76f11f0a1a8..84657241845 100644 --- a/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java +++ b/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java @@ -679,9 +679,31 @@ public class HBaseFsck { } prevKey = key; } + if (details) { + // do full region split map dump + dump(sc.getSplits(), regions); + } return errors.getErrorList().size() == originalErrorsCount; } + /** + * This dumps data in a visually reasonable way for visual debugging + * + * @param splits + * @param regions + */ + void dump(TreeSet splits, Multimap regions) { + // we display this way because the last end key should be displayed as well. + for (byte[] k : splits) { + System.out.print(Bytes.toString(k) + ":\t"); + for (HbckInfo r : regions.get(k)) { + System.out.print("[ "+ r.toString() + ", " + + Bytes.toString(r.getEndKey())+ "]\t"); + } + System.out.println(); + } + } + } /**