Package org.apache.accumulo.core.client

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


     
      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


  @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

      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

    IteratorSetting is = new IteratorSetting(5, RegExFilter.class);
    RegExFilter.setRegexs(is, s2, null, null, null, true, true);

    Scanner scanner = conn.createScanner(table, new Authorizations());
    scanner.addScanIterator(is);

    assertTrue("Client side iterator couldn't find a match when it should have", scanner.iterator().hasNext());

    conn.tableOperations().attachIterator(table, is);
    assertTrue("server side iterator couldn't find a match when it should have", conn.createScanner(table, new Authorizations()).iterator().hasNext());
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

    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

    ZooKeeperInstance instance = new ZooKeeperInstance(cluster.getInstanceName(), cluster.getZooKeepers());
    Connector connector = instance.getConnector("root", new PasswordToken(secret));
    final Scanner s = connector.createScanner(table, Constants.NO_AUTHS);
    IteratorSetting cfg = new IteratorSetting(30, SlowIterator.class);
    cfg.addOption("sleepTime", "500");
    s.addScanIterator(cfg);

    Thread thread = new Thread() {
      public void run() {
        try {
          for (@SuppressWarnings("unused")
View Full Code Here

        }
        setupMaxVersions(scanner, maxVersions);
        if (rowRegex != null || colfRegex != null || colqRegex != null || valueRegex != null) {
          IteratorSetting is = new IteratorSetting(50, RegExFilter.class);
          RegExFilter.setRegexs(is, rowRegex, colfRegex, colqRegex, valueRegex, false);
          scanner.addScanIterator(is);
        }
        setupIterators(scanner, iterators, options);
      } catch (Exception e) {
        throw new IOException(e);
      }
View Full Code Here

    // handle first argument, if present, the authorizations list to
    // scan with
    final Authorizations auths = getAuths(cl, shellState);
    final Scanner scanner = shellState.getConnector().createScanner(tableName, auths);
   
    scanner.addScanIterator(new IteratorSetting(Integer.MAX_VALUE, "NOVALUE", SortedKeyIterator.class));
   
    // handle session-specific scan iterators
    addScanIterators(shellState, cl, scanner, tableName);
   
    // handle remaining optional arguments
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

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.