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
This commit is contained in:
Michael Stack 2011-09-18 18:00:30 +00:00
parent cadd288c29
commit ddb6a6870d
2 changed files with 24 additions and 0 deletions

View File

@ -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

View File

@ -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<byte[]> splits, Multimap<byte[], HbckInfo> 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();
}
}
}
/**