From 3f1f587266d999eba3adcf7986e68c4fa0f42a82 Mon Sep 17 00:00:00 2001 From: anoopsamjohn Date: Tue, 15 Nov 2016 10:57:41 +0530 Subject: [PATCH] HBASE-17087 Enable Aliasing for CodedInputStream created by ByteInputByteString#newCodedInput. --- .../com/google/protobuf/ByteInputByteString.java | 4 +++- .../src/main/patches/HBASE-17087.patch | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 hbase-protocol-shaded/src/main/patches/HBASE-17087.patch diff --git a/hbase-protocol-shaded/src/main/java/org/apache/hadoop/hbase/shaded/com/google/protobuf/ByteInputByteString.java b/hbase-protocol-shaded/src/main/java/org/apache/hadoop/hbase/shaded/com/google/protobuf/ByteInputByteString.java index 1949602500c..30de4ec33ac 100644 --- a/hbase-protocol-shaded/src/main/java/org/apache/hadoop/hbase/shaded/com/google/protobuf/ByteInputByteString.java +++ b/hbase-protocol-shaded/src/main/java/org/apache/hadoop/hbase/shaded/com/google/protobuf/ByteInputByteString.java @@ -244,6 +244,8 @@ final class ByteInputByteString extends ByteString.LeafByteString { public CodedInputStream newCodedInput() { // We trust CodedInputStream not to modify the bytes, or to give anyone // else access to them. - return CodedInputStream.newInstance(buffer, offset, length, true); + CodedInputStream cis = CodedInputStream.newInstance(buffer, offset, length, true); + cis.enableAliasing(true); + return cis; } } diff --git a/hbase-protocol-shaded/src/main/patches/HBASE-17087.patch b/hbase-protocol-shaded/src/main/patches/HBASE-17087.patch new file mode 100644 index 00000000000..3826efe712a --- /dev/null +++ b/hbase-protocol-shaded/src/main/patches/HBASE-17087.patch @@ -0,0 +1,14 @@ +diff --git a/hbase-protocol-shaded/src/main/java/org/apache/hadoop/hbase/shaded/com/google/protobuf/ByteInputByteString.java b/hbase-protocol-shaded/src/main/java/org/apache/hadoop/hbase/shaded/com/google/protobuf/ByteInputByteString.java +index 1949602..30de4ec 100644 +--- a/hbase-protocol-shaded/src/main/java/org/apache/hadoop/hbase/shaded/com/google/protobuf/ByteInputByteString.java ++++ b/hbase-protocol-shaded/src/main/java/org/apache/hadoop/hbase/shaded/com/google/protobuf/ByteInputByteString.java +@@ -244,6 +244,8 @@ final class ByteInputByteString extends ByteString.LeafByteString { + public CodedInputStream newCodedInput() { + // We trust CodedInputStream not to modify the bytes, or to give anyone + // else access to them. +- return CodedInputStream.newInstance(buffer, offset, length, true); ++ CodedInputStream cis = CodedInputStream.newInstance(buffer, offset, length, true); ++ cis.enableAliasing(true); ++ return cis; + } + }