use of org.apache.hadoop.hbase.util.PositionedByteRange in project hbase by apache.
the class TestOrderedInt16 method testEncodedLength.
@Test
public void testEncodedLength() {
final PositionedByteRange buffer = new SimplePositionedMutableByteRange(20);
for (final DataType<Short> type : new OrderedInt16[] { new OrderedInt16(Order.ASCENDING), new OrderedInt16(Order.DESCENDING) }) {
for (final Short 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.PositionedByteRange 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.PositionedByteRange 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.PositionedByteRange 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));
}
}
}
use of org.apache.hadoop.hbase.util.PositionedByteRange in project hbase by apache.
the class TestOrderedNumeric method testEncodedBigDecimalLength.
@Test
public void testEncodedBigDecimalLength() {
final PositionedByteRange buffer = new SimplePositionedMutableByteRange(20);
for (final DataType<Number> type : new OrderedNumeric[] { new OrderedNumeric(Order.ASCENDING), new OrderedNumeric(Order.DESCENDING) }) {
for (final Number val : BIG_DECIMAL_VALUES) {
buffer.setPosition(0);
type.encode(buffer, val);
assertEquals("encodedLength does not match actual, " + val, buffer.getPosition(), type.encodedLength(val));
}
}
}
Aggregations