hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject [5/7] hbase git commit: Amend HBASE-18026 ProtobufUtil seems to do extra array copying
Date Tue, 16 May 2017 01:36:12 GMT
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 <apurtell@apache.org>


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

Branch: refs/heads/branch-1.3
Commit: d18eb62d8d0f02ea822090f409c2ded6f5279c3d
Parents: 36ebe05
Author: Vincent <vincent.poon@salesforce.com>
Authored: Sun May 14 19:26:15 2017 -0700
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Mon May 15 18:09:42 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/d18eb62d/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 9d75612..d0acd4c 100644
--- a/hbase-protocol/src/main/java/com/google/protobuf/HBaseZeroCopyByteString.java
+++ b/hbase-protocol/src/main/java/com/google/protobuf/HBaseZeroCopyByteString.java
@@ -68,7 +68,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();
   }
 }


Mime
View raw message