use of org.apache.hadoop.hbase.util.SimplePositionedMutableByteRange in project hbase by apache.
the class TestOrderedFloat64 method testEncodedLength.
@Test
public void testEncodedLength() {
final PositionedByteRange buffer = new SimplePositionedMutableByteRange(20);
for (final DataType<Double> type : new OrderedFloat64[] { new OrderedFloat64(Order.ASCENDING), new OrderedFloat64(Order.DESCENDING) }) {
for (final Double 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 TestOrderedFloat64 method testEncodedFloatLength.
@Test
public void testEncodedFloatLength() {
final PositionedByteRange buffer = new SimplePositionedMutableByteRange(20);
for (final OrderedFloat64 type : new OrderedFloat64[] { new OrderedFloat64(Order.ASCENDING), new OrderedFloat64(Order.DESCENDING) }) {
for (final Double val : VALUES) {
buffer.setPosition(0);
type.encodeDouble(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 TestOrderedInt32 method testEncodeNoSupportForNull.
@Test
public void testEncodeNoSupportForNull() {
exception.expect(IllegalArgumentException.class);
final DataType<Integer> type = new OrderedInt32(Order.ASCENDING);
type.encode(new SimplePositionedMutableByteRange(20), null);
}
use of org.apache.hadoop.hbase.util.SimplePositionedMutableByteRange in project hbase by apache.
the class TestOrderedInt8 method testEncodedFloatLength.
@Test
public void testEncodedFloatLength() {
final PositionedByteRange buffer = new SimplePositionedMutableByteRange(20);
for (final OrderedInt8 type : new OrderedInt8[] { new OrderedInt8(Order.ASCENDING), new OrderedInt8(Order.DESCENDING) }) {
for (final Byte val : VALUES) {
buffer.setPosition(0);
type.encodeByte(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 TestOrderedInt8 method testEncodedLength.
@Test
public void testEncodedLength() {
final PositionedByteRange buffer = new SimplePositionedMutableByteRange(20);
for (final DataType<Byte> type : new OrderedInt8[] { new OrderedInt8(Order.ASCENDING), new OrderedInt8(Order.DESCENDING) }) {
for (final Byte val : VALUES) {
buffer.setPosition(0);
type.encode(buffer, val);
assertEquals("encodedLength does not match actual, " + val, buffer.getPosition(), type.encodedLength(val));
}
}
}
Aggregations