You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ap...@apache.org on 2009/04/07 20:23:00 UTC

svn commit: r762889 - in /hadoop/hbase/trunk: CHANGES.txt src/java/org/apache/hadoop/hbase/io/hfile/HFile.java

Author: apurtell
Date: Tue Apr  7 18:22:59 2009
New Revision: 762889

URL: http://svn.apache.org/viewvc?rev=762889&view=rev
Log:
HBASE-1309 HFile rejects key in Memcache with empty value

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/io/hfile/HFile.java

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=762889&r1=762888&r2=762889&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Tue Apr  7 18:22:59 2009
@@ -137,6 +137,7 @@
                (Jonathan Gray via Andrew Purtell)
    HBASE-1205  RegionServers should find new master when a new master comes up
                (Nitay Joffe via Andrew Purtell)
+   HBASE-1309  HFile rejects key in Memcache with empty value
 
 Release 0.19.0 - 01/21/2009
   INCOMPATIBLE CHANGES

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/io/hfile/HFile.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/io/hfile/HFile.java?rev=762889&r1=762888&r2=762889&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/io/hfile/HFile.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/io/hfile/HFile.java Tue Apr  7 18:22:59 2009
@@ -452,7 +452,9 @@
       this.out.writeInt(value.length);
       this.valuelength += valuelength;
       this.out.write(key);
-      this.out.write(value);
+      if (value.length > 0) {
+        this.out.write(value);
+      }
       // Are we the first key in this block?
       if (this.firstKey == null) this.firstKey = key;
       this.lastKey = key;
@@ -481,8 +483,8 @@
     }
 
     private void checkValue(final byte [] value) throws IOException {
-      if (value == null || value.length <= 0) {
-        throw new IOException("Value cannot be null or empty");
+      if (value == null) {
+        throw new IOException("Value cannot be null");
       }
     }