Search in sources :

Example 46 with PositionedByteRange

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));
        }
    }
}
Also used : SimplePositionedMutableByteRange(org.apache.hadoop.hbase.util.SimplePositionedMutableByteRange) PositionedByteRange(org.apache.hadoop.hbase.util.PositionedByteRange) Test(org.junit.Test)

Example 47 with PositionedByteRange

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));
        }
    }
}
Also used : SimplePositionedMutableByteRange(org.apache.hadoop.hbase.util.SimplePositionedMutableByteRange) PositionedByteRange(org.apache.hadoop.hbase.util.PositionedByteRange) Test(org.junit.Test)

Example 48 with PositionedByteRange

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));
        }
    }
}
Also used : SimplePositionedMutableByteRange(org.apache.hadoop.hbase.util.SimplePositionedMutableByteRange) PositionedByteRange(org.apache.hadoop.hbase.util.PositionedByteRange) Test(org.junit.Test)

Example 49 with PositionedByteRange

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));
        }
    }
}
Also used : SimplePositionedMutableByteRange(org.apache.hadoop.hbase.util.SimplePositionedMutableByteRange) PositionedByteRange(org.apache.hadoop.hbase.util.PositionedByteRange) Test(org.junit.Test)

Example 50 with PositionedByteRange

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));
        }
    }
}
Also used : SimplePositionedMutableByteRange(org.apache.hadoop.hbase.util.SimplePositionedMutableByteRange) PositionedByteRange(org.apache.hadoop.hbase.util.PositionedByteRange) Test(org.junit.Test)

Aggregations

PositionedByteRange (org.apache.hadoop.hbase.util.PositionedByteRange)63 SimplePositionedMutableByteRange (org.apache.hadoop.hbase.util.SimplePositionedMutableByteRange)61 Test (org.junit.Test)39 HColumnDescriptor (org.apache.hadoop.hbase.HColumnDescriptor)16 HTableDescriptor (org.apache.hadoop.hbase.HTableDescriptor)16 BufferedMutator (org.apache.hadoop.hbase.client.BufferedMutator)16 Put (org.apache.hadoop.hbase.client.Put)16 ByteBuf (io.netty.buffer.ByteBuf)6 FunctionCall (org.apache.drill.common.expression.FunctionCall)4 LogicalExpression (org.apache.drill.common.expression.LogicalExpression)4 SchemaPath (org.apache.drill.common.expression.SchemaPath)4 BooleanExpression (org.apache.drill.common.expression.ValueExpressions.BooleanExpression)4 DateExpression (org.apache.drill.common.expression.ValueExpressions.DateExpression)4 DoubleExpression (org.apache.drill.common.expression.ValueExpressions.DoubleExpression)4 FloatExpression (org.apache.drill.common.expression.ValueExpressions.FloatExpression)4 IntExpression (org.apache.drill.common.expression.ValueExpressions.IntExpression)4 LongExpression (org.apache.drill.common.expression.ValueExpressions.LongExpression)4 QuotedString (org.apache.drill.common.expression.ValueExpressions.QuotedString)4 TimeExpression (org.apache.drill.common.expression.ValueExpressions.TimeExpression)4 Order (org.apache.hadoop.hbase.util.Order)4