You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2011/05/24 07:06:09 UTC

svn commit: r1126868 - in /hbase/branches/0.90: ./ conf/ src/main/java/org/apache/hadoop/hbase/executor/ src/main/java/org/apache/hadoop/hbase/util/ src/main/java/org/apache/hadoop/hbase/zookeeper/

Author: stack
Date: Tue May 24 05:06:09 2011
New Revision: 1126868

URL: http://svn.apache.org/viewvc?rev=1126868&view=rev
Log:
HBASE-3195 Binary row keys in hbck and other miscellaneous binary key display issues

Modified:
    hbase/branches/0.90/CHANGES.txt
    hbase/branches/0.90/conf/hbase-env.sh
    hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/executor/RegionTransitionData.java
    hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
    hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java

Modified: hbase/branches/0.90/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/CHANGES.txt?rev=1126868&r1=1126867&r2=1126868&view=diff
==============================================================================
--- hbase/branches/0.90/CHANGES.txt (original)
+++ hbase/branches/0.90/CHANGES.txt Tue May 24 05:06:09 2011
@@ -16,6 +16,8 @@ Release 0.90.4 - Unreleased
                keys. (Ted Yu)
    HBASE-3912  [Stargate] Columns not handle by Scan
    HBASE-3908  TableSplit not implementing "hashCode" problem (Daniel Iancu)
+   HBASE-3195  Binary row keys in hbck and other miscellaneous binary key
+               display issues
 
   IMPROVEMENT
    HBASE-3882  hbase-config.sh needs to be updated so it can auto-detects the

Modified: hbase/branches/0.90/conf/hbase-env.sh
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/conf/hbase-env.sh?rev=1126868&r1=1126867&r2=1126868&view=diff
==============================================================================
--- hbase/branches/0.90/conf/hbase-env.sh (original)
+++ hbase/branches/0.90/conf/hbase-env.sh Tue May 24 05:06:09 2011
@@ -36,8 +36,8 @@
 # see http://wiki.apache.org/hadoop/PerformanceTuning
 export HBASE_OPTS="-ea -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode"
 
-# Uncomment below to enable java garbage collection logging.
-# export HBASE_OPTS="$HBASE_OPTS -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:$HBASE_HOME/logs/gc-hbase.log" 
+# Uncomment below to enable java garbage collection logging in the .out file.
+# export HBASE_OPTS="$HBASE_OPTS -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps" 
 
 # Uncomment and adjust to enable JMX exporting
 # See jmxremote.password and jmxremote.access in $JRE_HOME/lib/management to configure remote password access.

Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/executor/RegionTransitionData.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/executor/RegionTransitionData.java?rev=1126868&r1=1126867&r2=1126868&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/executor/RegionTransitionData.java (original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/executor/RegionTransitionData.java Tue May 24 05:06:09 2011
@@ -204,7 +204,7 @@ public class RegionTransitionData implem
 
   @Override
   public String toString() {
-    return "region=" + Bytes.toString(regionName) + ", server=" + serverName +
-      ", state=" + eventType;
+    return "region=" + Bytes.toStringBinary(regionName) +
+      ", server=" + serverName + ", state=" + eventType;
   }
 }

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=1126868&r1=1126867&r2=1126868&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 Tue May 24 05:06:09 2011
@@ -386,12 +386,8 @@ public class HBaseFsck {
     if (inMeta && inHdfs && isDeployed && deploymentMatchesMeta && shouldBeDeployed) {
       return;
     } else if (inMeta && !isDeployed && splitParent) {
-      // Offline regions shouldn't cause complaints
-      LOG.debug("Region " + descriptiveName + " offline, split, parent, ignoring.");
       return;
     } else if (inMeta && !shouldBeDeployed && !isDeployed) {
-      // offline regions shouldn't cause complaints
-      LOG.debug("Region " + descriptiveName + " offline, ignoring.");
       return;
     } else if (recentlyModified) {
       LOG.warn("Region " + descriptiveName + " was recently modified -- skipping");
@@ -408,7 +404,7 @@ public class HBaseFsck {
     } else if (!inMeta && inHdfs && !isDeployed) {
       errors.reportError(ERROR_CODE.NOT_IN_META_OR_DEPLOYED, "Region "
           + descriptiveName + " on HDFS, but not listed in META " +
-          "or deployed on any region server.");
+          "or deployed on any region server");
     } else if (!inMeta && inHdfs && isDeployed) {
       errors.reportError(ERROR_CODE.NOT_IN_META, "Region " + descriptiveName
           + " not in META, but deployed on " + Joiner.on(", ").join(hbi.deployedOn));
@@ -549,6 +545,7 @@ public class HBaseFsck {
     public boolean checkRegionChain() {
       Collections.sort(regions);
       HbckInfo last = null;
+      int originalErrorsCount = errors.getErrorList().size();
 
       for (HbckInfo r : regions) {
         if (last == null) {
@@ -572,8 +569,8 @@ public class HBaseFsck {
               errors.reportError(ERROR_CODE.REGION_CYCLE,
                   String.format("The endkey for this region comes before the "
                       + "startkey, startkey=%s, endkey=%s",
-                      Bytes.toString(r.metaEntry.getStartKey()),
-                      Bytes.toString(r.metaEntry.getEndKey())),
+                      Bytes.toStringBinary(r.metaEntry.getStartKey()),
+                      Bytes.toStringBinary(r.metaEntry.getEndKey())),
                   this, r, last);
             }
           }
@@ -582,7 +579,7 @@ public class HBaseFsck {
           if (Bytes.equals(r.metaEntry.getStartKey(), last.metaEntry.getStartKey())) {
             errors.reportError(ERROR_CODE.DUPE_STARTKEYS,
                 "Two regions have the same startkey: "
-                    + Bytes.toString(r.metaEntry.getStartKey()),
+                    + Bytes.toStringBinary(r.metaEntry.getStartKey()),
                 this, r, last);
           } else {
             // Check that the startkey is the same as the previous end key
@@ -606,7 +603,7 @@ public class HBaseFsck {
         last = r;
       }
 
-      return errors.getErrorList().size() == 0;
+      return errors.getErrorList().size() == originalErrorsCount;
     }
 
   }

Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java?rev=1126868&r1=1126867&r2=1126868&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java (original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java Tue May 24 05:06:09 2011
@@ -1113,6 +1113,6 @@ public class ZKUtil {
       (data == null? "null": (
           znode.startsWith(zkw.assignmentZNode) ?
               RegionTransitionData.fromBytes(data).toString()
-              : StringUtils.abbreviate(Bytes.toString(data), 32)))));
+              : StringUtils.abbreviate(Bytes.toStringBinary(data), 32)))));
   }
 }