Package org.apache.hadoop.hbase.client.idx.exp

Examples of org.apache.hadoop.hbase.client.idx.exp.Expression


   * to default region scan in case an expression was not provided.
   */
  @Override
  protected InternalScanner instantiateInternalScanner(Scan scan,
    List<KeyValueScanner> additionalScanners) throws IOException {
    Expression expression = IdxScan.getExpression(scan);
    if (scan == null || expression == null) {
      totalNonIndexedScans.incrementAndGet();
      return super.instantiateInternalScanner(scan, additionalScanners);
    } else {
      totalIndexedScans.incrementAndGet();
View Full Code Here


    EasyMock.replay(index);
    searchContext.indices.put(Pair.of(column, qualifier), index);

    // perform the test
    IdxExpressionEvaluator evaluator = new IdxExpressionEvaluator();
    Expression exp = Expression.comparison(column, qualifier, Comparison.Operator.EQ, value);
    IntSet intSet = evaluator.evaluate(searchContext, exp);

    // assert the evaluator interacted with the indices correctly
    Assert.assertNotNull("The response from the evaluator should not be null", intSet);
    EasyMock.verify(index);
View Full Code Here

    EasyMock.replay(index2);
    searchContext.indices.put(Pair.of(column2, qualifier2), index2);

    // perform the test
    IdxExpressionEvaluator evaluator = new IdxExpressionEvaluator();
    Expression exp = Expression.or(
        Expression.comparison(column1, qualifier1, Comparison.Operator.LT, value1),
        Expression.comparison(column2, qualifier2, Comparison.Operator.GT, value2)
    );
    IntSet intSet = evaluator.evaluate(searchContext, exp);
View Full Code Here

    EasyMock.replay(index2);
    searchContext.indices.put(Pair.of(column2, qualifier2), index2);

    // perform the test
    IdxExpressionEvaluator evaluator = new IdxExpressionEvaluator();
    Expression exp = Expression.and(
        Expression.comparison(column1, qualifier1, Comparison.Operator.LTE, value1),
        Expression.comparison(column2, qualifier2, Comparison.Operator.GTE, value2)
    );
    IntSet intSet = evaluator.evaluate(searchContext, exp);
View Full Code Here

    EasyMock.replay(index3);
    searchContext.indices.put(Pair.of(column3, qualifier3), index3);

    // perform the test
    IdxExpressionEvaluator evaluator = new IdxExpressionEvaluator();
    Expression exp = Expression.or(
        Expression.and(
            Expression.comparison(column1, qualifier1, Comparison.Operator.LTE, value1),
            Expression.comparison(column2, qualifier2, Comparison.Operator.GTE, value2)
        ),
        Expression.comparison(column3, qualifier3, Comparison.Operator.EQ, value3)
View Full Code Here

  /**
   * Test that ensures that if an expression contains a reference to a column/qualifier
   * that doesn't exists the correct error is thrown.
   */
  public void testNullIndex() {
    Expression exp = Expression.comparison("column", "qualifier", Comparison.Operator.EQ, Bytes.toBytes("value"));

    IdxExpressionEvaluator evaluator = new IdxExpressionEvaluator();
    IntSet result = null;
    try {
      result = evaluator.evaluate(searchContext, exp);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.client.idx.exp.Expression

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.