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

Examples of org.apache.hadoop.hbase.client.idx.IdxScan


      Put put = new Put(Bytes.toBytes(String.format("%08d", i)));
      put.add(family, qualLong, Bytes.toBytes(i));
      region.put(put);
    }

    IdxScan idxScan = new IdxScan();
    idxScan.addFamily(family);
    int low = numRows / 10;
    int high = numRows - low;
    idxScan.setExpression(Or.or(Comparison.comparison(family, qualLong, Comparison.Operator.GTE, Bytes.toBytes((long) high)),
      Comparison.comparison(family, qualLong, Comparison.Operator.LT, Bytes.toBytes((long) low))));
    idxScan.setFilter(new FilterList(FilterList.Operator.MUST_PASS_ONE,
      Arrays.<Filter>asList(
        new SingleColumnValueFilter(family, qualLong, CompareFilter.CompareOp.GREATER_OR_EQUAL,
          new BinaryComparator(Bytes.toBytes((long) high))),
        new SingleColumnValueFilter(family, qualLong, CompareFilter.CompareOp.LESS,
          new BinaryComparator(Bytes.toBytes((long) low))))
View Full Code Here


    Store store = region.stores.values().iterator().next();
    Assert.assertTrue("number of files " + store.getNumberOfstorefiles(),
      store.getNumberOfstorefiles() > 1);
    Assert.assertTrue(store.memstore.size.get() > 0);

    IdxScan idxScan = new IdxScan();
    idxScan.addFamily(family);
    int low = numRows / 10;
    int high = numRows - low;
    idxScan.setExpression(Or.or(Comparison.comparison(family, qualLong, Comparison.Operator.GTE, Bytes.toBytes((long) high)),
      Comparison.comparison(family, qualLong, Comparison.Operator.LT, Bytes.toBytes((long) low))));
    idxScan.setFilter(new FilterList(FilterList.Operator.MUST_PASS_ONE,
      Arrays.<Filter>asList(
        new SingleColumnValueFilter(family, qualLong, CompareFilter.CompareOp.GREATER_OR_EQUAL,
          new BinaryComparator(Bytes.toBytes((long) high))),
        new SingleColumnValueFilter(family, qualLong, CompareFilter.CompareOp.LESS,
          new BinaryComparator(Bytes.toBytes((long) low))))
View Full Code Here

    initIdxRegion(tableName, method, new HBaseConfiguration(), Pair.of(family,
      new IdxIndexDescriptor[]{indexDescriptor}));
    FlushThread flushThread = new FlushThread();
    flushThread.start();

    IdxScan idxScan = new IdxScan();
    idxScan.addFamily(family);
    idxScan.setExpression(Comparison.comparison(family, qualLong,
      Comparison.Operator.EQ, Bytes.toBytes((5L))));
    idxScan.setFilter(new SingleColumnValueFilter(family, qualLong,
      CompareFilter.CompareOp.EQUAL, new BinaryComparator(Bytes.toBytes(5L))));

    int expectedCount = 0;
    List<KeyValue> res = new ArrayList<KeyValue>();
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.client.idx.IdxScan

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.