Package org.apache.hadoop.hbase.index.client

Examples of org.apache.hadoop.hbase.index.client.EqualsExpression


  public void testSingleIndexExpressionWithOneEqualsExpression() throws Exception {
    String indexName = "idx1";
    SingleIndexExpression singleIndexExpression = new SingleIndexExpression(indexName);
    byte[] value = "1".getBytes();
    Column column = new Column(FAMILY1, QUALIFIER1);
    EqualsExpression equalsExpression = new EqualsExpression(column, value);
    singleIndexExpression.addEqualsExpression(equalsExpression);

    Scan scan = new Scan();
    scan.setAttribute(Constants.INDEX_EXPRESSION, IndexUtils.toBytes(singleIndexExpression));
    Filter filter = new SingleColumnValueFilter(FAMILY1, QUALIFIER1, CompareOp.EQUAL, value);
View Full Code Here


    String indexName = "idx1";
    SingleIndexExpression singleIndexExpression = new SingleIndexExpression(indexName);
    byte[] value1 = "1".getBytes();
    byte[] value2 = Bytes.toBytes(1234);
    Column column = new Column(FAMILY1, QUALIFIER1);
    EqualsExpression equalsExpression = new EqualsExpression(column, value1);
    singleIndexExpression.addEqualsExpression(equalsExpression);
    column = new Column(FAMILY1, QUALIFIER2);
    equalsExpression = new EqualsExpression(column, value2);
    singleIndexExpression.addEqualsExpression(equalsExpression);
    column = new Column(FAMILY1, QUALIFIER3);
    byte[] value3_1 = Bytes.toBytes(10.4F);
    byte[] value3_2 = Bytes.toBytes(16.91F);
    RangeExpression re = new RangeExpression(column, value3_1, value3_2, true, false);
View Full Code Here

    MultiIndexExpression multiIndexExpression = new MultiIndexExpression(GroupingCondition.AND);
    String index1 = "idx1";
    SingleIndexExpression singleIndexExpression = new SingleIndexExpression(index1);
    byte[] value2 = Bytes.toBytes(1234);
    Column column = new Column(FAMILY1, QUALIFIER2);
    EqualsExpression equalsExpression = new EqualsExpression(column, value2);
    singleIndexExpression.addEqualsExpression(equalsExpression);
    column = new Column(FAMILY1, QUALIFIER3);
    byte[] value3_1 = Bytes.toBytes(10.4F);
    byte[] value3_2 = Bytes.toBytes(16.91F);
    RangeExpression re = new RangeExpression(column, value3_1, value3_2, true, false);
    singleIndexExpression.setRangeExpression(re);
    multiIndexExpression.addIndexExpression(singleIndexExpression);

    MultiIndexExpression multiIndexExpression2 = new MultiIndexExpression(GroupingCondition.OR);
    String index2 = "idx2";
    singleIndexExpression = new SingleIndexExpression(index2);
    byte[] value1 = Bytes.toBytes("asdf");
    column = new Column(FAMILY1, QUALIFIER1);
    equalsExpression = new EqualsExpression(column, value1);
    singleIndexExpression.addEqualsExpression(equalsExpression);
    multiIndexExpression2.addIndexExpression(singleIndexExpression);

    String index3 = "idx3";
    singleIndexExpression = new SingleIndexExpression(index3);
    byte[] value4 = Bytes.toBytes(567.009D);
    column = new Column(FAMILY2, QUALIFIER1);
    equalsExpression = new EqualsExpression(column, value4);
    singleIndexExpression.addEqualsExpression(equalsExpression);
    multiIndexExpression2.addIndexExpression(singleIndexExpression);

    multiIndexExpression.addIndexExpression(multiIndexExpression2);
View Full Code Here

    Scan scan = new Scan();
    SingleIndexExpression singleIndexExpression = new SingleIndexExpression("idx1");
    byte[] value = "huawei".getBytes();
    Column column = new Column("cf1".getBytes(), "cq".getBytes(), vp);
    EqualsExpression equalsExpression = new EqualsExpression(column, value);
    singleIndexExpression.addEqualsExpression(equalsExpression);
    scan.setAttribute(Constants.INDEX_EXPRESSION, IndexUtils.toBytes(singleIndexExpression));
    scan.setFilter(new SingleColumnValuePartitionFilter(hcd.getName(), "cq".getBytes(),
        CompareOp.EQUAL, "huawei".getBytes(), vp));
    int i = 0;
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.index.client.EqualsExpression

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.