diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java index feddc2c..ea01f76 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java @@ -834,7 +834,9 @@ public class HFile { int read = in.read(pbuf); if (read != pblen) throw new IOException("read=" + read + ", wanted=" + pblen); if (ProtobufUtil.isPBMagicPrefix(pbuf)) { - parsePB(HFileProtos.FileInfoProto.parseDelimitedFrom(in)); + HFileProtos.FileInfoProto.Builder builder = HFileProtos.FileInfoProto.newBuilder(); + ProtobufUtil.mergeDelimitedFrom(builder, in); + parsePB(builder.build()); } else { if (in.markSupported()) { in.reset(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestDefaultMobStoreFlusher.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestDefaultMobStoreFlusher.java index 3454614..0e2b8ac 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestDefaultMobStoreFlusher.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestDefaultMobStoreFlusher.java @@ -44,7 +44,7 @@ public class TestDefaultMobStoreFlusher { private final static byte [] row1 = Bytes.toBytes("row1"); private final static byte [] row2 = Bytes.toBytes("row2"); private final static byte [] family = Bytes.toBytes("family"); - private final static byte [] qf1 = Bytes.toBytes("qf1"); + private final static byte [] qf1 = new byte[1<<26]; private final static byte [] qf2 = Bytes.toBytes("qf2"); private final static byte [] value1 = Bytes.toBytes("value1"); private final static byte [] value2 = Bytes.toBytes("value2"); @@ -54,6 +54,8 @@ public class TestDefaultMobStoreFlusher { @BeforeClass public static void setUpBeforeClass() throws Exception { + TEST_UTIL.getConfiguration().setInt(ConnectionConfiguration.MAX_KEYVALUE_SIZE_KEY, 1<<26+1); + TEST_UTIL.getConfiguration().setInt("hbase.server.keyvalue.maxsize", 1<<26+1); TEST_UTIL.startMiniCluster(1); }