Package co.nubetech.crux.model

Examples of co.nubetech.crux.model.RowAlias


    type.setType("Pattern Matches");

    ValueType valueType = new ValueType();
    valueType.setClassName("java.lang.String");

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

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

    SubRegexStringComparator expectedComp = new SubRegexStringComparator(
        "abc", 0, -1);
    RowFilter expectedFilter = new RowFilter(CompareOp.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);
    SubRegexStringComparator returnedComparator = (SubRegexStringComparator) filterReturned
View Full Code Here


    type.setType("Pattern Not Matches");

    ValueType valueType = new ValueType();
    valueType.setClassName("java.lang.String");

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

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

    SubRegexStringComparator expectedComp = new SubRegexStringComparator(
        "abc", 0, -1);
    RowFilter expectedFilter = new RowFilter(CompareOp.NOT_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);
    SubRegexStringComparator returnedComparator = (SubRegexStringComparator) filterReturned
View Full Code Here

    FilterType type = new FilterType(1, "Greater Than");

    ValueType valueType = new ValueType(1, null, "java.lang.Long",
        "java.lang.Long", "java.lang.Long", true);

    RowAlias alias = new RowAlias(1, null, valueType, 8, "alias");

    RowAliasFilter rowFilter = new RowAliasFilter(null, type, "123", alias);

    FilterType type1 = new FilterType(2, "Substring");

    ValueType valueType1 = new ValueType(2, null, "java.lang.String",
        "java.lang.String", false);

    RowAlias alias1 = new RowAlias(2, null, valueType1, 6, "alias1");

    RowAliasFilter rowFilter1 = new RowAliasFilter(null, type1, "Substr",
        alias1);

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

    mapping.setRowAlias(rowAliases);

    ArrayList<RowAliasFilter> greaterFilters = new ArrayList<RowAliasFilter>();
    greaterFilters.add(rowFilter);
View Full Code Here

    FilterType type = new FilterType();

    ValueType valueType = new ValueType();
    valueType.setClassName("java.lang.Long");

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

    LongComparator expectedComp = new LongComparator(123l, 0, -1);
    LongComparator returnedComparator = (LongComparator) HBaseFilterFactory
        .getComparator(type, alias, "123", 0, -1);
    assertTrue(Bytes.compareTo(expectedComp.getValue(),
View Full Code Here

    FilterType type = new FilterType();

    ValueType valueType = new ValueType();
    valueType.setClassName("java.lang.Integer");

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

    IntComparator expectedComp = new IntComparator(123, 0, -1);
    IntComparator returnedComparator = (IntComparator) HBaseFilterFactory
        .getComparator(type, alias, "123", 0, -1);
    assertTrue(Bytes.compareTo(expectedComp.getValue(),
View Full Code Here

    FilterType type = new FilterType();

    ValueType valueType = new ValueType();
    valueType.setClassName("java.lang.Short");

    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(),
View Full Code Here

    FilterType type = new FilterType();

    ValueType valueType = new ValueType();
    valueType.setClassName("java.lang.Float");

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

    FloatComparator expectedComp = new FloatComparator(123, 0, -1);
    FloatComparator returnedComparator = (FloatComparator) HBaseFilterFactory
        .getComparator(type, alias, "123", 0, -1);
    assertTrue(Bytes.compareTo(expectedComp.getValue(),
View Full Code Here

    FilterType type = new FilterType();

    ValueType valueType = new ValueType();
    valueType.setClassName("java.lang.Double");

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

    DoubleComparator expectedComp = new DoubleComparator(123, 0, -1);
    DoubleComparator returnedComparator = (DoubleComparator) HBaseFilterFactory
        .getComparator(type, alias, "123", 0, -1);
    assertTrue(Bytes.compareTo(expectedComp.getValue(),
View Full Code Here

    FilterType type = new FilterType();

    ValueType valueType = new ValueType();
    valueType.setClassName("java.lang.Boolean");

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

    BooleanComparator expectedComp = new BooleanComparator(true, 0, -1);
    BooleanComparator returnedComparator = (BooleanComparator) HBaseFilterFactory
        .getComparator(type, alias, "true", 0, -1);
    assertTrue(Bytes.compareTo(expectedComp.getValue(),
View Full Code Here

    type.setType("Equals");

    ValueType valueType = new ValueType();
    valueType.setClassName("java.lang.String");

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

    SubBinaryComparator expectedComp = new SubBinaryComparator(
        Bytes.toBytes("abc"), 0, -1);

    SubBinaryComparator returnedComparator = (SubBinaryComparator) HBaseFilterFactory
View Full Code Here

TOP

Related Classes of co.nubetech.crux.model.RowAlias

Copyright © 2018 www.massapicom. 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.