HBASE-1309 HFile rejects key in Memcache with empty value

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@762889 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andrew Kyle Purtell 2009-04-07 18:22:59 +00:00
parent 88a42b8ce6
commit 90e8591cb4
2 changed files with 6 additions and 3 deletions

View File

@ -137,6 +137,7 @@ Release 0.20.0 - Unreleased
(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

View File

@ -452,7 +452,9 @@ public class HFile {
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 @@ public class HFile {
}
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");
}
}