You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2014/01/27 17:26:41 UTC
svn commit: r1561725 -
/hbase/trunk/hbase-protocol/src/main/java/com/google/protobuf/ZeroCopyLiteralByteString.java
Author: stack
Date: Mon Jan 27 16:26:41 2014
New Revision: 1561725
URL: http://svn.apache.org/r1561725
Log:
HBASE-10422 ZeroCopyLiteralByteString.zeroCopyGetBytes has an unusable prototype and conflicts with AsyncHBase
Modified:
hbase/trunk/hbase-protocol/src/main/java/com/google/protobuf/ZeroCopyLiteralByteString.java
Modified: hbase/trunk/hbase-protocol/src/main/java/com/google/protobuf/ZeroCopyLiteralByteString.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-protocol/src/main/java/com/google/protobuf/ZeroCopyLiteralByteString.java?rev=1561725&r1=1561724&r2=1561725&view=diff
==============================================================================
--- hbase/trunk/hbase-protocol/src/main/java/com/google/protobuf/ZeroCopyLiteralByteString.java (original)
+++ hbase/trunk/hbase-protocol/src/main/java/com/google/protobuf/ZeroCopyLiteralByteString.java Mon Jan 27 16:26:41 2014
@@ -57,7 +57,12 @@ public final class ZeroCopyLiteralByteSt
* @param buf A buffer from which to extract the array. This buffer must be
* actually an instance of a {@code LiteralByteString}.
*/
- public static byte[] zeroCopyGetBytes(final LiteralByteString buf) {
- return buf.bytes;
+ public static byte[] zeroCopyGetBytes(final ByteString buf) {
+ if (buf instanceof LiteralByteString) {
+ return ((LiteralByteString) buf).bytes;
+ }
+ throw new UnsupportedOperationException("Need a LiteralByteString, got a "
+ + buf.getClass().getName());
}
+
}