Examples of SingleColumnValueFilter


Examples of org.apache.hadoop.hbase.filter.SingleColumnValueFilter

  throws IOException {
    // Defaults FilterList.Operator.MUST_PASS_ALL.
    FilterList allFilters = new FilterList();
    allFilters.addFilter(new PrefixFilter(Bytes.toBytes(keyPrefix)));
    // Only return rows where this column value exists in the row.
    SingleColumnValueFilter filter =
      new SingleColumnValueFilter(Bytes.toBytes("trans-tags"),
        Bytes.toBytes("qual2"), CompareOp.EQUAL, Bytes.toBytes(value));
    filter.setFilterIfMissing(true);
    allFilters.addFilter(filter);
    Scan scan = new Scan();
    scan.addFamily(Bytes.toBytes("trans-blob"));
    scan.addFamily(Bytes.toBytes("trans-type"));
    scan.addFamily(Bytes.toBytes("trans-date"));
View Full Code Here

Examples of org.apache.hadoop.hbase.filter.SingleColumnValueFilter

      FlushThread flushThread = new FlushThread();
      flushThread.start();

      Scan scan = new Scan();
      scan.addFamily(family);
      scan.setFilter(new SingleColumnValueFilter(family, qual1,
          CompareOp.EQUAL, new BinaryComparator(Bytes.toBytes(5L))));

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

Examples of org.apache.hadoop.hbase.filter.SingleColumnValueFilter

      region.put(put);

      Scan idxScan = new Scan();
      idxScan.addFamily(family);
      idxScan.setFilter(new FilterList(FilterList.Operator.MUST_PASS_ALL,
          Arrays.<Filter>asList(new SingleColumnValueFilter(family, qual1,
              CompareOp.GREATER_OR_EQUAL,
              new BinaryComparator(Bytes.toBytes(0L))),
              new SingleColumnValueFilter(family, qual1, CompareOp.LESS_OR_EQUAL,
                  new BinaryComparator(Bytes.toBytes(3L)))
              )));
      InternalScanner scanner = region.getScanner(idxScan);
      List<KeyValue> res = new ArrayList<KeyValue>();
View Full Code Here

Examples of org.apache.hadoop.hbase.filter.SingleColumnValueFilter

      puts.add(createPut(rowkey, value));
    }
    ht.put(puts);
    Scan scan = new Scan();
    FilterList fl = new FilterList(Operator.MUST_PASS_ALL);
    SingleColumnValueFilter scvf = new SingleColumnValueFilter(FAMILY1, QUALIFIER3,
        CompareOp.EQUAL, Bytes.toBytes("v1"));
    //fl.addFilter(new FirstKeyOnlyFilter());
    fl.addFilter(scvf);
    scan.setFilter(fl);
    // Deleting all the rows where cf1:c1=v1
View Full Code Here

Examples of org.apache.hadoop.hbase.filter.SingleColumnValueFilter

    public boolean verify(byte[] rowKey, byte[] cf, Set<byte[]> columnSet) {
      return columnMap.get(cf).length == columnSet.size();
    }

    public Filter getScanFilter() {
      SingleColumnValueFilter scf = new SingleColumnValueFilter(ESSENTIAL_CF, FILTER_COLUMN,
          CompareFilter.CompareOp.EQUAL, Bytes.toBytes(ACCEPTED_VALUE));
      scf.setFilterIfMissing(true);
      return scf;
    }
View Full Code Here

Examples of org.apache.hadoop.hbase.filter.SingleColumnValueFilter

        if (scanner != null) scanner.close();
      }
    }

    protected Scan constructScan(byte[] valuePrefix) throws IOException {
      Filter filter = new SingleColumnValueFilter(
          FAMILY_NAME, QUALIFIER_NAME, CompareFilter.CompareOp.EQUAL,
          new BinaryComparator(valuePrefix)
      );
      Scan scan = new Scan();
      scan.addColumn(FAMILY_NAME, QUALIFIER_NAME);
View Full Code Here

Examples of org.apache.hadoop.hbase.filter.SingleColumnValueFilter

    protected Scan constructScan(byte[] valuePrefix) throws IOException {
      Scan scan = new Scan();
      scan.addColumn(FAMILY_NAME, QUALIFIER_NAME);
      FilterList list = new FilterList();
      list.addFilter(new SingleColumnValueFilter(
          FAMILY_NAME, QUALIFIER_NAME, CompareFilter.CompareOp.EQUAL,
          new BinaryComparator(valuePrefix)
      ));
      if (this.filterAll) {
        list.addFilter(new FilterAllFilter());
View Full Code Here

Examples of org.apache.hadoop.hbase.filter.SingleColumnValueFilter

  throws IOException {
    // Defaults FilterList.Operator.MUST_PASS_ALL.
    FilterList allFilters = new FilterList();
    allFilters.addFilter(new PrefixFilter(Bytes.toBytes(keyPrefix)));
    // Only return rows where this column value exists in the row.
    SingleColumnValueFilter filter =
      new SingleColumnValueFilter(Bytes.toBytes("trans-tags"),
        Bytes.toBytes("qual2"), CompareOp.EQUAL, Bytes.toBytes(value));
    filter.setFilterIfMissing(true);
    allFilters.addFilter(filter);
    Scan scan = new Scan();
    scan.addFamily(Bytes.toBytes("trans-blob"));
    scan.addFamily(Bytes.toBytes("trans-type"));
    scan.addFamily(Bytes.toBytes("trans-date"));
View Full Code Here

Examples of org.apache.hadoop.hbase.filter.SingleColumnValueFilter

      FlushThread flushThread = new FlushThread();
      flushThread.start();

      Scan scan = new Scan();
      scan.addFamily(family);
      scan.setFilter(new SingleColumnValueFilter(family, qual1,
          CompareOp.EQUAL, new BinaryComparator(Bytes.toBytes(5L))));

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

Examples of org.apache.hadoop.hbase.filter.SingleColumnValueFilter

      region.put(put);

      Scan idxScan = new Scan();
      idxScan.addFamily(family);
      idxScan.setFilter(new FilterList(FilterList.Operator.MUST_PASS_ALL,
          Arrays.<Filter>asList(new SingleColumnValueFilter(family, qual1,
              CompareOp.GREATER_OR_EQUAL,
              new BinaryComparator(Bytes.toBytes(0L))),
              new SingleColumnValueFilter(family, qual1, CompareOp.LESS_OR_EQUAL,
                  new BinaryComparator(Bytes.toBytes(3L)))
              )));
      InternalScanner scanner = region.getScanner(idxScan);
      List<KeyValue> res = new ArrayList<KeyValue>();
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.