From 5d4ed8436d0cf5c89bde8849cb685c0dbe132ba2 Mon Sep 17 00:00:00 2001 From: Jim Kellerman Date: Fri, 14 Mar 2008 05:57:54 +0000 Subject: [PATCH] HBASE-516 HStoreFile.finalKey does not update the final key if it is not the top region of a split region Modified HStoreFile$HalfMapFileReader.finalKey git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@637002 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 2 ++ .../apache/hadoop/hbase/regionserver/HStoreFile.java | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) 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); } }