Return-Path: Delivered-To: apmail-hbase-commits-archive@www.apache.org Received: (qmail 291 invoked from network); 4 Dec 2010 00:12:10 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 4 Dec 2010 00:12:10 -0000 Received: (qmail 75074 invoked by uid 500); 4 Dec 2010 00:12:10 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 75052 invoked by uid 500); 4 Dec 2010 00:12:10 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 75045 invoked by uid 99); 4 Dec 2010 00:12:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 04 Dec 2010 00:12:10 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 04 Dec 2010 00:12:09 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 5152B2388B1B; Sat, 4 Dec 2010 00:10:38 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1042061 - /hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java Date: Sat, 04 Dec 2010 00:10:38 -0000 To: commits@hbase.apache.org From: stack@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101204001038.5152B2388B1B@eris.apache.org> Author: stack Date: Sat Dec 4 00:10:38 2010 New Revision: 1042061 URL: http://svn.apache.org/viewvc?rev=1042061&view=rev Log: Some fixup of hbck log messages -- added info Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java?rev=1042061&r1=1042060&r2=1042061&view=diff ============================================================================== --- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java (original) +++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java Sat Dec 4 00:10:38 2010 @@ -244,12 +244,14 @@ public class HBaseFsck { // This is special case if a region is left after split hbi.onlyEdits = true; FileStatus[] subDirs = fs.listStatus(regionDir.getPath()); - Path ePath = HLog.getRegionDirRecoveredEditsDir(regionDir.getPath()); - for (FileStatus subDir : subDirs) { - String sdName = subDir.getPath().getName(); - if (!sdName.startsWith(".") && !sdName.equals(ePath.getName())) { - hbi.onlyEdits = false; - break; + if (subDirs != null) { + Path ePath = HLog.getRegionDirRecoveredEditsDir(regionDir.getPath()); + for (FileStatus subDir : subDirs) { + String sdName = subDir.getPath().getName(); + if (!sdName.startsWith(".") && !sdName.equals(ePath.getName())) { + hbi.onlyEdits = false; + break; + } } } } @@ -324,15 +326,16 @@ public class HBaseFsck { * Check consistency of all regions that have been found in previous phases. */ void checkConsistency() throws IOException { - for (HbckInfo hbi : regionInfo.values()) { - doConsistencyCheck(hbi); + for (java.util.Map.Entry e: regionInfo.entrySet()) { + doConsistencyCheck(e.getKey(), e.getValue()); } } /** * Check a single region for consistency and correct deployment. */ - void doConsistencyCheck(HbckInfo hbi) throws IOException { + void doConsistencyCheck(final String key, final HbckInfo hbi) + throws IOException { String descriptiveName = hbi.toString(); boolean inMeta = hbi.metaEntry != null; @@ -366,7 +369,7 @@ public class HBaseFsck { // We shouldn't have record of this region at all then! assert false : "Entry for region with no data"; } else if (!inMeta && !inHdfs && isDeployed) { - errors.reportError("Region " + descriptiveName + " not on HDFS or in META but " + + errors.reportError("Region " + descriptiveName + ", key=" + key + ", not on HDFS or in META but " + "deployed on " + Joiner.on(", ").join(hbi.deployedOn)); } else if (!inMeta && inHdfs && !isDeployed) { errors.reportError("Region " + descriptiveName + " on HDFS, but not listed in META " + @@ -391,7 +394,7 @@ public class HBaseFsck { HBaseFsckRepair.fixUnassigned(this.conf, hbi.metaEntry); } } else if (inMeta && inHdfs && isDeployed && !shouldBeDeployed) { - errors.reportError("Region " + descriptiveName + " has should not be deployed according " + + errors.reportError("Region " + descriptiveName + " should not be deployed according " + "to META, but is deployed on " + Joiner.on(", ").join(hbi.deployedOn)); } else if (inMeta && inHdfs && isMultiplyDeployed) { errors.reportError("Region " + descriptiveName + " is listed in META on region server " + @@ -732,7 +735,7 @@ public class HBaseFsck { } else if (foundRegionDir != null) { return foundRegionDir.getPath().toString(); } else { - return "unknown region on " + Joiner.on(", ").join(deployedOn); + return "UNKNOWN_REGION on " + Joiner.on(", ").join(deployedOn); } } }