Package org.apache.accumulo.core.client

Examples of org.apache.accumulo.core.client.Scanner.addScanIterator()


      if (query.getStartTime() != -1)
        TimestampFilter.setStart(is, query.getStartTime(), true);
      if (query.getEndTime() != -1)
        TimestampFilter.setEnd(is, query.getEndTime(), true);

      scanner.addScanIterator(is);
    }

    return scanner;
  }
View Full Code Here


  @Override
  public long deleteByQuery(Query<K,T> query) {
    try {
      Scanner scanner = createScanner(query);
      // add iterator that drops values on the server side
      scanner.addScanIterator(new IteratorSetting(Integer.MAX_VALUE, SortedKeyIterator.class));
      RowIterator iterator = new RowIterator(scanner.iterator());

      long count = 0;

      while (iterator.hasNext()) {
View Full Code Here

      System.out.println("executing middle wildcard search for " + regexString + " from entries ending with " + lastPart);
      scanner.setRange(Range.prefix(getReverseIndex(lastPart)));
    }
    IteratorSetting regex = new IteratorSetting(50, "regex", RegExFilter.class);
    RegExFilter.setRegexs(regex, null, null, regexString, null, false);
    scanner.addScanIterator(regex);
    return scanner;
  }
 
  public static class Opts extends ClientOnRequiredTable {
    @Parameter(names="--path", description="the directory to list")
View Full Code Here

     
      if (opts != null) {
        if (opts.iterators != null) {
          for (org.apache.accumulo.proxy.thrift.IteratorSetting iter : opts.iterators) {
            IteratorSetting is = new IteratorSetting(iter.getPriority(), iter.getName(), iter.getIteratorClass(), iter.getProperties());
            scanner.addScanIterator(is);
          }
        }
        org.apache.accumulo.proxy.thrift.Range prange = opts.range;
        if (prange != null) {
          Range range = new Range(Util.fromThrift(prange.getStart()), prange.startInclusive, Util.fromThrift(prange.getStop()), prange.stopInclusive);
View Full Code Here

        if (conf.get(ROW_REGEX) != null || conf.get(COLUMN_FAMILY_REGEX) != null || conf.get(COLUMN_QUALIFIER_REGEX) != null ||
            conf.get(VALUE_REGEX) != null) {
          IteratorSetting is = new IteratorSetting(50, RegExFilter.class);
          RegExFilter.setRegexs(is, conf.get(ROW_REGEX), conf.get(COLUMN_FAMILY_REGEX), conf.get(COLUMN_QUALIFIER_REGEX),
            conf.get(VALUE_REGEX), false);
          scanner.addScanIterator(is);
        }
        setupIterators(conf, scanner);
      } catch (Exception e) {
        throw new IOException(e);
      }
View Full Code Here

      return;
    }
   
    Connector connector = HdfsZooInstance.getInstance().getConnector(SecurityConstants.getSystemCredentials());
    Scanner scanner = connector.createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS);
    scanner.addScanIterator(new IteratorSetting(1, "keys-only", SortedKeyIterator.class));
   
    if (table == null) {
      scanner.setRange(new Range(new Text("~err_"), false, new Text("~err`"), false));
    } else {
      scanner.setRange(new Range(new Text("~err_" + table)));
View Full Code Here

    private String getTabletStats() throws Exception {
      Connector conn = instance.getConnector(user, pass);
     
      Scanner scanner = conn.createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS);
      scanner.fetchColumnFamily(Constants.METADATA_DATAFILE_COLUMN_FAMILY);
      scanner.addScanIterator(new IteratorSetting(1000, "cfc", ColumnFamilyCounter.class.getName()));
      scanner.setRange(new KeyExtent(new Text(tableId), null, null).toMetadataRange());
     
      Stat s = new Stat();
     
      int count = 0;
View Full Code Here

    for (Entry<Key,Value> entry : scanner) {
      entry.getKey();
    }
   
    // set a non existant iterator, should cause scan to fail on server side
    scanner.addScanIterator(new IteratorSetting(100, "bogus", "com.bogus.iterator"));
   
    caught = false;
    try {
      for (Entry<Key,Value> entry : scanner) {
        // should error
View Full Code Here

    // handle first argument, if present, the authorizations list to
    // scan with
    Authorizations auths = getAuths(cl, shellState);
    final Scanner scanner = shellState.getConnector().createScanner(tableName, auths);
   
    scanner.addScanIterator(new IteratorSetting(Integer.MAX_VALUE, "NOVALUE", SortedKeyIterator.class));
   
    // handle remaining optional arguments
    scanner.setRange(getRange(cl));
   
    // handle columns
View Full Code Here

    // initialize a scanner to ensure the new setting does not conflict with existing settings
    String user = shellState.getConnector().whoami();
    Authorizations auths = shellState.getConnector().securityOperations().getUserAuthorizations(user);
    Scanner scanner = shellState.getConnector().createScanner(tableName, auths);
    for (IteratorSetting s : tableScanIterators) {
      scanner.addScanIterator(s);
    }
    scanner.addScanIterator(setting);
   
    // if no exception has been thrown, it's safe to add it to the list
    tableScanIterators.add(setting);
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.