use of org.apache.hadoop.hbase.util.SimplePositionedMutableByteRange in project hbase by apache.
the class TestOrderedInt16 method testEncodeNoSupportForNull.
@Test
public void testEncodeNoSupportForNull() {
exception.expect(IllegalArgumentException.class);
final DataType<Short> type = new OrderedInt16(Order.ASCENDING);
type.encode(new SimplePositionedMutableByteRange(20), null);
}
use of org.apache.hadoop.hbase.util.SimplePositionedMutableByteRange in project hbase by apache.
the class TestOrderedInt16 method testEncodedFloatLength.
@Test
public void testEncodedFloatLength() {
final PositionedByteRange buffer = new SimplePositionedMutableByteRange(20);
for (final OrderedInt16 type : new OrderedInt16[] { new OrderedInt16(Order.ASCENDING), new OrderedInt16(Order.DESCENDING) }) {
for (final Short val : VALUES) {
buffer.setPosition(0);
type.encodeShort(buffer, val);
assertEquals("encodedLength does not match actual, " + val, buffer.getPosition(), type.encodedLength(val));
}
}
}
use of org.apache.hadoop.hbase.util.SimplePositionedMutableByteRange in project hbase by apache.
the class TestOrderedInt64 method testEncodeNoSupportForNull.
@Test
public void testEncodeNoSupportForNull() {
exception.expect(IllegalArgumentException.class);
final DataType<Long> type = new OrderedInt64(Order.ASCENDING);
type.encode(new SimplePositionedMutableByteRange(20), null);
}
use of org.apache.hadoop.hbase.util.SimplePositionedMutableByteRange in project hbase by apache.
the class TestOrderedInt64 method testEncodedLength.
@Test
public void testEncodedLength() {
final PositionedByteRange buffer = new SimplePositionedMutableByteRange(20);
for (final DataType<Long> type : new OrderedInt64[] { new OrderedInt64(Order.ASCENDING), new OrderedInt64(Order.DESCENDING) }) {
for (final Long val : VALUES) {
buffer.setPosition(0);
type.encode(buffer, val);
assertEquals("encodedLength does not match actual, " + val, buffer.getPosition(), type.encodedLength(val));
}
}
}
use of org.apache.hadoop.hbase.util.SimplePositionedMutableByteRange in project hbase by apache.
the class TestOrderedInt64 method testEncodedFloatLength.
@Test
public void testEncodedFloatLength() {
final PositionedByteRange buffer = new SimplePositionedMutableByteRange(20);
for (final OrderedInt64 type : new OrderedInt64[] { new OrderedInt64(Order.ASCENDING), new OrderedInt64(Order.DESCENDING) }) {
for (final Long val : VALUES) {
buffer.setPosition(0);
type.encodeLong(buffer, val);
assertEquals("encodedLength does not match actual, " + val, buffer.getPosition(), type.encodedLength(val));
}
}
}
Aggregations