diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityConstants.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityConstants.java index bc84207b5cd..f98efec8ebd 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityConstants.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityConstants.java @@ -46,7 +46,7 @@ public final class VisibilityConstants { **/ public static final byte VISIBILITY_SERIALIZATION_VERSION = 1; /** Byte representation of the visibility_serialization_version **/ - public static final byte[] SORTED_ORDINAL_SERIALIZATION_FORMAT = Bytes - .toBytes(VISIBILITY_SERIALIZATION_VERSION); + public static final byte[] SORTED_ORDINAL_SERIALIZATION_FORMAT = + new byte[] { VISIBILITY_SERIALIZATION_VERSION }; } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityUtils.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityUtils.java index 33ccab692af..35843ff90cf 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityUtils.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityUtils.java @@ -181,7 +181,7 @@ public class VisibilityUtils { while (tagsIterator.hasNext()) { Tag tag = tagsIterator.next(); if (tag.getType() == VisibilityUtils.VISIBILITY_EXP_SERIALIZATION_TAG_TYPE) { - int serializationVersion = Bytes.toShort(tag.getBuffer()); + int serializationVersion = tag.getBuffer()[tag.getTagOffset()]; if (serializationVersion == VisibilityConstants.VISIBILITY_SERIALIZATION_VERSION) { sortedOrder = true; continue;