You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by sy...@apache.org on 2016/10/07 19:15:29 UTC
[61/77] [abbrv] hbase git commit: HBASE-16760 Deprecate ByteString
related methods in Bytes.java.
HBASE-16760 Deprecate ByteString related methods in Bytes.java.
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/6a9b57b3
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/6a9b57b3
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/6a9b57b3
Branch: refs/heads/hbase-12439
Commit: 6a9b57b39520780441a236df3bb8d4ef208c4edb
Parents: 5ae516b
Author: anoopsamjohn <an...@gmail.com>
Authored: Wed Oct 5 11:19:37 2016 +0530
Committer: anoopsamjohn <an...@gmail.com>
Committed: Wed Oct 5 11:19:37 2016 +0530
----------------------------------------------------------------------
.../main/java/org/apache/hadoop/hbase/util/Bytes.java | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/6a9b57b3/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java
index 2d7d3f6..626132b 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java
@@ -28,7 +28,6 @@ import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.nio.ByteBuffer;
-import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.security.SecureRandom;
import java.util.Arrays;
@@ -66,13 +65,6 @@ import com.google.protobuf.ByteString;
value="EQ_CHECK_FOR_OPERAND_NOT_COMPATIBLE_WITH_THIS",
justification="It has been like this forever")
public class Bytes implements Comparable<Bytes> {
- //HConstants.UTF8_ENCODING should be updated if this changed
- /** When we encode strings, we always specify UTF8 encoding */
- private static final String UTF8_ENCODING = "UTF-8";
-
- //HConstants.UTF8_CHARSET should be updated if this changed
- /** When we encode strings, we always specify UTF8 encoding */
- private static final Charset UTF8_CHARSET = Charset.forName(UTF8_ENCODING);
// Using the charset canonical name for String/byte[] conversions is much
// more efficient due to use of cached encoders/decoders.
@@ -193,7 +185,9 @@ public class Bytes implements Comparable<Bytes> {
/**
* Copy bytes from ByteString instance.
* @param byteString copy from
+ * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0.
*/
+ @Deprecated
public Bytes(final ByteString byteString) {
this(byteString.toByteArray());
}
@@ -259,6 +253,10 @@ public class Bytes implements Comparable<Bytes> {
return this.offset;
}
+ /**
+ * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0.
+ */
+ @Deprecated
public ByteString toByteString() {
return ByteString.copyFrom(this.bytes, this.offset, this.length);
}