Examples of ShortComparator


Examples of co.nubetech.crux.server.filter.types.ShortComparator

    RowAliasFilter rowFilter = new RowAliasFilter();
    rowFilter.setFilterType(type);
    rowFilter.setValue("123");
    rowFilter.setRowAlias(alias);

    ShortComparator expectedComp = new ShortComparator((short) 123, 0, 2);
    RowFilter expectedFilter = new RowFilter(CompareOp.LESS_OR_EQUAL,
        expectedComp);

    Mapping mapping = new Mapping();
    Map<String, RowAlias> rowAliases = new TreeMap<String, RowAlias>();
    rowAliases.put(alias.getAlias(), alias);
    mapping.setRowAlias(rowAliases);

    RowFilter filterReturned = HBaseFilterFactory.getRowFilter(rowFilter,
        mapping);
    ShortComparator returnedComparator = (ShortComparator) filterReturned
        .getComparator();

    assertTrue(Bytes.compareTo(expectedComp.getValue(),
        returnedComparator.getValue()) == 0);
    assertEquals(expectedFilter.getOperator(), filterReturned.getOperator());
    assertEquals(expectedComp.getLength(), returnedComparator.getLength());
    assertEquals(expectedComp.getOffset(), returnedComparator.getOffset());
  }
View Full Code Here

Examples of co.nubetech.crux.server.filter.types.ShortComparator

    RowAliasFilter rowFilter = new RowAliasFilter();
    rowFilter.setFilterType(type);
    rowFilter.setValue("123");
    rowFilter.setRowAlias(alias);

    ShortComparator expectedComp = new ShortComparator((short) 123, 0, 2);
    RowFilter expectedFilter = new RowFilter(CompareOp.GREATER_OR_EQUAL,
        expectedComp);

    Mapping mapping = new Mapping();
    Map<String, RowAlias> rowAliases = new TreeMap<String, RowAlias>();
    rowAliases.put(alias.getAlias(), alias);
    mapping.setRowAlias(rowAliases);

    RowFilter filterReturned = HBaseFilterFactory.getRowFilter(rowFilter,
        mapping);
    ShortComparator returnedComparator = (ShortComparator) filterReturned
        .getComparator();

    assertTrue(Bytes.compareTo(expectedComp.getValue(),
        returnedComparator.getValue()) == 0);
    assertEquals(expectedFilter.getOperator(), filterReturned.getOperator());
    assertEquals(expectedComp.getLength(), returnedComparator.getLength());
    assertEquals(expectedComp.getOffset(), returnedComparator.getOffset());
  }
View Full Code Here

Examples of co.nubetech.crux.server.filter.types.ShortComparator

    RowAliasFilter rowFilter = new RowAliasFilter();
    rowFilter.setFilterType(type);
    rowFilter.setValue("123");
    rowFilter.setRowAlias(alias);

    ShortComparator expectedComp = new ShortComparator((short) 123, 0, 2);
    RowFilter expectedFilter = new RowFilter(CompareOp.GREATER,
        expectedComp);

    Mapping mapping = new Mapping();
    Map<String, RowAlias> rowAliases = new TreeMap<String, RowAlias>();
    rowAliases.put(alias.getAlias(), alias);
    mapping.setRowAlias(rowAliases);

    RowFilter filterReturned = HBaseFilterFactory.getRowFilter(rowFilter,
        mapping);
    ShortComparator returnedComparator = (ShortComparator) filterReturned
        .getComparator();

    assertTrue(Bytes.compareTo(expectedComp.getValue(),
        returnedComparator.getValue()) == 0);
    assertEquals(expectedFilter.getOperator(), filterReturned.getOperator());
    assertEquals(expectedComp.getLength(), returnedComparator.getLength());
    assertEquals(expectedComp.getOffset(), returnedComparator.getOffset());
  }
View Full Code Here

Examples of co.nubetech.crux.server.filter.types.ShortComparator

    RowAlias alias = new RowAlias();
    alias.setAlias("alias");
    alias.setValueType(valueType);
    alias.setLength(-1);

    ShortComparator expectedComp = new ShortComparator((short) 123, 0, -1);
    ShortComparator returnedComparator = (ShortComparator) HBaseFilterFactory
        .getComparator(type, alias, "123", 0, -1);
    assertTrue(Bytes.compareTo(expectedComp.getValue(),
        returnedComparator.getValue()) == 0);
    assertEquals(expectedComp.getLength(), returnedComparator.getLength());
    assertEquals(expectedComp.getOffset(), returnedComparator.getOffset());
  }
View Full Code Here

Examples of eu.stratosphere.api.common.typeutils.base.ShortComparator

public class ShortComparatorTest extends ComparatorTestBase<Short> {

  @Override
  protected TypeComparator<Short> createComparator(boolean ascending) {
    return new ShortComparator(ascending);
  }
View Full Code Here

Examples of org.apache.directory.mavibot.btree.comparator.ShortComparator

    /**
     * Create a new instance of ShortSerializer
     */
    public ShortSerializer()
    {
        super( new ShortComparator() );
    }
View Full Code Here

Examples of org.apache.directory.mavibot.btree.comparator.ShortComparator

    /**
     * Create a new instance of ShortSerializer
     */
    public ShortSerializer()
    {
        super( new ShortComparator() );
    }
View Full Code Here

Examples of org.apache.directory.mavibot.btree.comparator.ShortComparator

    /**
     * Create a new instance of ShortSerializer
     */
    public ShortSerializer()
    {
        super( new ShortComparator() );
    }
View Full Code Here

Examples of org.apache.directory.mavibot.btree.comparator.ShortComparator

public class ShortComparatorTest
{
    @Test
    public void testShortComparator()
    {
        ShortComparator comparator = new ShortComparator();

        assertEquals( 0, comparator.compare( null, null ) );
        assertEquals( 0, comparator.compare( ( short ) 1, ( short ) 1 ) );
        assertEquals( 0, comparator.compare( ( short ) -1, ( short ) -1 ) );
        assertEquals( 1, comparator.compare( ( short ) 1, null ) );
        assertEquals( 1, comparator.compare( ( short ) 2, ( short ) 1 ) );
        assertEquals( 1, comparator.compare( ( short ) 3, ( short ) 1 ) );
        assertEquals( 1, comparator.compare( ( short ) 1, ( short ) -1 ) );
        assertEquals( -1, comparator.compare( null, ( short ) 1 ) );
        assertEquals( -1, comparator.compare( ( short ) 1, ( short ) 2 ) );
        assertEquals( -1, comparator.compare( ( short ) -1, ( short ) 1 ) );
    }
View Full Code Here

Examples of org.apache.flink.api.common.typeutils.base.ShortComparator

public class ShortComparatorTest extends ComparatorTestBase<Short> {

  @Override
  protected TypeComparator<Short> createComparator(boolean ascending) {
    return new ShortComparator(ascending);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.