hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nspiegelb...@apache.org
Subject svn commit: r1181571 - /hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/HServerLoad.java
Date Tue, 11 Oct 2011 02:21:30 GMT
Author: nspiegelberg
Date: Tue Oct 11 02:21:29 2011
New Revision: 1181571

URL: http://svn.apache.org/viewvc?rev=1181571&view=rev
Log:
Restore interoperability with old clients/servers after HFile v2 changes

Summary:
HFile v2 changes added three new region load metrics (rootIndexSizeKB,
totalStaticIndexSizeKB, and totalStaticBloomSizeKB) and resulted in a client
that was incompatible with the old server, and a server that was incompatible
with the old client, because the serialization format of HServerLoad changed. I
am now removing these new fields from the serialized format. They will still be
accessible through the region server web UI, but won't show up in the output of
the "status 'detailed'" command in the hbase shell.

Thanks to Madhu for catching this bug.

Test Plan:
Tested on a five-node cluster. Still need to do tests with real old clients and
servers.

Reviewed By: kannan
Reviewers: madhuvaidya, kannan
CC: hbase@lists, , kannan
Revert Plan:
OK. This actually fixes a backwards-compatibility issue.

Differential Revision: 270343

Modified:
    hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/HServerLoad.java

Modified: hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/HServerLoad.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/HServerLoad.java?rev=1181571&r1=1181570&r2=1181571&view=diff
==============================================================================
--- hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/HServerLoad.java (original)
+++ hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/HServerLoad.java Tue Oct 11
02:21:29 2011
@@ -70,19 +70,24 @@ public class HServerLoad implements Writ
      */
     private int storefileIndexSizeMB;
 
-    /** The current total size of root-level indexes for the region, in KB */
-    private int rootIndexSizeKB;
+    /**
+     * The current total size of root-level indexes for the region, in KB. Not
+     * serialized because of backwards-compatibility issues.
+     */
+    private int rootIndexSizeKB = -1;
 
     /**
-     * The total size of all index blocks, not just the root level, in KB.
+     * The total size of all index blocks, not just the root level, in KB. Not
+     * serialized because of backwards-compatibility issues.
      */
-    private int totalStaticIndexSizeKB;
+    private int totalStaticIndexSizeKB = -1;
 
     /**
      * The total size of all Bloom filter blocks, not just loaded into the
-     * block cache, in KB.
+     * block cache, in KB. Not serialized because of backwards-compatibility
+     * issues.
      */
-    private int totalStaticBloomSizeKB;
+    private int totalStaticBloomSizeKB = -1;
 
     /**
      * Constructor, for Writable
@@ -214,9 +219,6 @@ public class HServerLoad implements Writ
       this.storefileSizeMB = in.readInt();
       this.memstoreSizeMB = in.readInt();
       this.storefileIndexSizeMB = in.readInt();
-      this.rootIndexSizeKB = in.readInt();
-      this.totalStaticIndexSizeKB = in.readInt();
-      this.totalStaticBloomSizeKB = in.readInt();
     }
 
     public void write(DataOutput out) throws IOException {
@@ -227,9 +229,6 @@ public class HServerLoad implements Writ
       out.writeInt(storefileSizeMB);
       out.writeInt(memstoreSizeMB);
       out.writeInt(storefileIndexSizeMB);
-      out.writeInt(rootIndexSizeKB);
-      out.writeInt(totalStaticIndexSizeKB);
-      out.writeInt(totalStaticBloomSizeKB);
     }
 
     /**
@@ -247,12 +246,21 @@ public class HServerLoad implements Writ
         Integer.valueOf(this.memstoreSizeMB));
       sb = Strings.appendKeyValue(sb, "storefileIndexSizeMB",
         Integer.valueOf(this.storefileIndexSizeMB));
-      sb = Strings.appendKeyValue(sb, "rootIndexSizeKB",
-          Integer.valueOf(this.rootIndexSizeKB));
-      sb = Strings.appendKeyValue(sb, "totalStaticIndexSizeKB",
-          Integer.valueOf(this.totalStaticIndexSizeKB));
-      sb = Strings.appendKeyValue(sb, "totalStaticBloomSizeKB",
+
+      if (rootIndexSizeKB != -1) {
+        sb = Strings.appendKeyValue(sb, "rootIndexSizeKB",
+            Integer.valueOf(this.rootIndexSizeKB));
+      }
+
+      if (totalStaticIndexSizeKB != -1) {
+        sb = Strings.appendKeyValue(sb, "totalStaticIndexSizeKB",
+            Integer.valueOf(this.totalStaticIndexSizeKB));
+      }
+
+      if (totalStaticBloomSizeKB != -1) {
+        sb = Strings.appendKeyValue(sb, "totalStaticBloomSizeKB",
           Integer.valueOf(this.totalStaticBloomSizeKB));
+      }
       return sb.toString();
     }
   }



Mime
View raw message