diff --git a/CHANGES.txt b/CHANGES.txt index 3b4ae13eb5f..bb78bd0bd3e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -40,6 +40,8 @@ Hbase Change Log HBASE-27 hregioninfo cell empty in meta table HBASE-501 Empty region server address in info:server entry and a startcode of -1 in .META. + HBASE-516 HStoreFile.finalKey does not update the final key if it is not + the top region of a split region IMPROVEMENTS HBASE-415 Rewrite leases to use DelayedBlockingQueue instead of polling diff --git a/src/java/org/apache/hadoop/hbase/regionserver/HStoreFile.java b/src/java/org/apache/hadoop/hbase/regionserver/HStoreFile.java index a979e4028f8..4b658090585 100644 --- a/src/java/org/apache/hadoop/hbase/regionserver/HStoreFile.java +++ b/src/java/org/apache/hadoop/hbase/regionserver/HStoreFile.java @@ -19,9 +19,12 @@ */ package org.apache.hadoop.hbase.regionserver; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; import java.io.DataInput; import java.io.DataInputStream; import java.io.DataOutput; +import java.io.DataOutputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.UnsupportedEncodingException; @@ -892,7 +895,14 @@ public class HStoreFile implements HConstants { } else { reset(); Writable value = new ImmutableBytesWritable(); - key = super.getClosest(midkey, value, true); + WritableComparable k = super.getClosest(midkey, value, true); + ByteArrayOutputStream byteout = new ByteArrayOutputStream(); + DataOutputStream out = new DataOutputStream(byteout); + k.write(out); + ByteArrayInputStream bytein = + new ByteArrayInputStream(byteout.toByteArray()); + DataInputStream in = new DataInputStream(bytein); + key.readFields(in); } }