diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/OrderedBytes.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/OrderedBytes.java index b99fc7b..b536208 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/OrderedBytes.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/OrderedBytes.java @@ -278,6 +278,7 @@ public class OrderedBytes { * implementations can be inserted into the total ordering enforced here. */ private static final byte NULL = 0x05; + // room for 1 expansion type private static final byte NEG_INF = 0x07; private static final byte NEG_LARGE = 0x08; private static final byte NEG_MED_MIN = 0x09; @@ -289,14 +290,21 @@ public class OrderedBytes { private static final byte POS_MED_MAX = 0x21; private static final byte POS_LARGE = 0x22; private static final byte POS_INF = 0x23; - private static final byte NAN = 0x25; - private static final byte FIXED_INT32 = 0x27; - private static final byte FIXED_INT64 = 0x28; + // room for 2 expansion type + private static final byte NAN = 0x26; + // room for 2 expansion types + @SuppressWarnings("unused") private static final byte FIXED_INT8 = 0x29; // reserved + @SuppressWarnings("unused") private static final byte FIXED_INT16 = 0x2a; // reserved + private static final byte FIXED_INT32 = 0x2b; + private static final byte FIXED_INT64 = 0x2c; + // room for 3 expansion types private static final byte FIXED_FLOAT32 = 0x30; private static final byte FIXED_FLOAT64 = 0x31; - private static final byte TEXT = 0x33; - private static final byte BLOB_VAR = 0x35; - private static final byte BLOB_COPY = 0x36; + // room for 2 expansion type + private static final byte TEXT = 0x34; + // room for 2 expansion type + private static final byte BLOB_VAR = 0x37; + private static final byte BLOB_COPY = 0x38; /* * The following constant values are used by encoding implementations diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestOrderedBytes.java b/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestOrderedBytes.java index 509d76e..1916da3 100644 --- a/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestOrderedBytes.java +++ b/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestOrderedBytes.java @@ -898,7 +898,8 @@ public class TestOrderedBytes { @Test(expected = IllegalArgumentException.class) public void testBlobCopyNoZeroBytes() { byte[] val = { 0x01, 0x02, 0x00, 0x03 }; - byte[] ascExpected = { 0x36, 0x01, 0x02, 0x00, 0x03 }; + // TODO: implementation detail leaked here. + byte[] ascExpected = { 0x38, 0x01, 0x02, 0x00, 0x03 }; PositionedByteRange buf = new SimplePositionedByteRange(val.length + 1); OrderedBytes.encodeBlobCopy(buf, val, Order.ASCENDING); assertArrayEquals(ascExpected, buf.getBytes());