hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject svn commit: r762889 - in /hadoop/hbase/trunk: CHANGES.txt src/java/org/apache/hadoop/hbase/io/hfile/HFile.java
Date Tue, 07 Apr 2009 18:23:00 GMT
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");
       }
     }
 



Mime
View raw message