HBASE-7 Provide a HBase checker and repair tool similar to fsck; add handling of disable parents

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@948203 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2010-05-25 20:50:04 +00:00
parent 9a5cef8aba
commit 41a4c36ec9
1 changed files with 7 additions and 3 deletions

View File

@ -134,15 +134,19 @@ while (result = scanner.next())
bytes = result.getValue(HConstants::CATALOG_FAMILY, HConstants::REGIONINFO_QUALIFIER)
hri = Writables.getHRegionInfo(bytes)
if oldHRI
unless Bytes.equals(oldHRI.getEndKey(), hri.getStartKey())
LOG.warn("hole after " + hri.toString())
if oldHRI.isOffline() && Bytes.equals(oldHRI.getStartKey(), hri.getStartKey())
# Presume offlined parent
elsif Bytes.equals(oldHRI.getEndKey(), hri.getStartKey())
# Start key of next matches end key of previous
else
LOG.warn("hole after " + oldHRI.toString())
if fixup
bad = 1 unless fixup(oldHRI, hri, metatable, fs, rootdir)
else
bad = 1
end
end
end
end
oldHRI = hri
end
scanner.close()