You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ap...@apache.org on 2017/05/16 01:36:14 UTC

[7/7] hbase git commit: Amend HBASE-18026 ProtobufUtil seems to do extra array copying

Amend HBASE-18026 ProtobufUtil seems to do extra array copying

If the ByteString is not a LiteralByteString, just do toByteArray().

Signed-off-by: Andrew Purtell <ap...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/2cff94c4
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/2cff94c4
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/2cff94c4

Branch: refs/heads/branch-1.1
Commit: 2cff94c40933ce4f431f733b2de6d44e3e19c6f1
Parents: 26cb211
Author: Vincent <vi...@salesforce.com>
Authored: Sun May 14 19:26:15 2017 -0700
Committer: Andrew Purtell <ap...@apache.org>
Committed: Mon May 15 18:09:48 2017 -0700

----------------------------------------------------------------------
 .../main/java/com/google/protobuf/HBaseZeroCopyByteString.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/2cff94c4/hbase-protocol/src/main/java/com/google/protobuf/HBaseZeroCopyByteString.java
----------------------------------------------------------------------
diff --git a/hbase-protocol/src/main/java/com/google/protobuf/HBaseZeroCopyByteString.java b/hbase-protocol/src/main/java/com/google/protobuf/HBaseZeroCopyByteString.java
index 933a6e2..78ddd02 100644
--- a/hbase-protocol/src/main/java/com/google/protobuf/HBaseZeroCopyByteString.java
+++ b/hbase-protocol/src/main/java/com/google/protobuf/HBaseZeroCopyByteString.java
@@ -61,7 +61,7 @@ public final class HBaseZeroCopyByteString extends LiteralByteString {
     if (buf instanceof LiteralByteString) {
       return ((LiteralByteString) buf).bytes;
     }
-    throw new UnsupportedOperationException("Need a LiteralByteString, got a "
-                                            + buf.getClass().getName());
+    // In case it's BoundedByteString
+    return buf.toByteArray();
   }
 }