Package org.apache.accumulo.core.client

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


    is.addOption(PrimitiveComparisonFilter.P_COMPARE_CLASS, IntCompare.class.getName());
    is.addOption(PrimitiveComparisonFilter.COMPARE_OPT_CLASS, GreaterThan.class.getName());
    is.addOption(PrimitiveComparisonFilter.CONST_VAL,
        new String(Base64.encodeBase64(parseIntBytes("1"))));
    is.addOption(PrimitiveComparisonFilter.COLUMN, "cf:sid");
    scan.addScanIterator(is);
    boolean foundMark = false;
    boolean foundDennis = false;
    int totalCount = 0;
    for (Map.Entry<Key,Value> kv : scan) {
      boolean foundName = false;
View Full Code Here


    is.addOption(PrimitiveComparisonFilter.P_COMPARE_CLASS, StringCompare.class.getName());
    is.addOption(PrimitiveComparisonFilter.COMPARE_OPT_CLASS, Equal.class.getName());
    is.addOption(PrimitiveComparisonFilter.CONST_VAL,
        new String(Base64.encodeBase64("brian".getBytes())));
    is.addOption(PrimitiveComparisonFilter.COLUMN, "cf:name");
    scan.addScanIterator(is);
    boolean foundName = false;
    boolean foundSid = false;
    boolean foundDegrees = false;
    boolean foundMillis = false;
    for (Map.Entry<Key,Value> kv : scan) {
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

      return;
    }
   
    Connector connector = HdfsZooInstance.getInstance().getConnector(SystemCredentials.get().getPrincipal(), SystemCredentials.get().getToken());
    Scanner scanner = connector.createScanner(MetadataTable.NAME, Authorizations.EMPTY);
    scanner.addScanIterator(new IteratorSetting(1, "keys-only", SortedKeyIterator.class));
   
    scanner.setRange(new Range(new Text("~err_" + table)));
   
    Mutation delMut = new Mutation(new Text("~err_" + table));
   
View Full Code Here

    scanner.setRange(new Range(row));
    IteratorSetting iterConf = new IteratorSetting(100, "cqsl", ColumnSliceFilter.class);
    ColumnSliceFilter.setSlice(iterConf, "bal", true, "bal", true);
    scanner.clearScanIterators();
    scanner.addScanIterator(iterConf);

    int count = 0;
    int sum = 0;
    int min = Integer.MAX_VALUE;
    int max = Integer.MIN_VALUE;
View Full Code Here

     
      Connector conn = opts.getConnector();
      Scanner scanner = conn.createScanner(MetadataTable.NAME, opts.auths);
      scanner.setBatchSize(scanBatchSize);
      scanner.fetchColumnFamily(DataFileColumnFamily.NAME);
      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

    IteratorSetting cfg = new IteratorSetting(100, SlowIterator.class);
    // A batch size of one will end up calling seek() for each element with no calls to next()
    SlowIterator.setSeekSleepTime(cfg, 100l);

    s.addScanIterator(cfg);
    // Never start readahead
    s.setReadaheadThreshold(Long.MAX_VALUE);
    s.setBatchSize(1);
    s.setRange(new Range());
View Full Code Here

    sw.stop();

    long millisWithWait = sw.elapsed(TimeUnit.MILLISECONDS);

    s = c.createScanner(table, new Authorizations());
    s.addScanIterator(cfg);
    s.setRange(new Range());
    s.setBatchSize(1);
    s.setReadaheadThreshold(0l);

    sw = new Stopwatch();
View Full Code Here

    bw.close();
   
    // check filter
    Scanner scanner = connector.createScanner(tableName, Authorizations.EMPTY);
    IteratorSetting is = new IteratorSetting(5, CustomFilter.class);
    scanner.addScanIterator(is);
    int count = 0;
    for (Entry<Key,Value> entry : scanner) {
      count++;
      assertEquals("allowed", entry.getKey().getColumnFamily().toString());
    }
View Full Code Here

    assertEquals(4, count);
   
    // check filter negated
    scanner.clearScanIterators();
    CustomFilter.setNegate(is, true);
    scanner.addScanIterator(is);
    count = 0;
    for (Entry<Key,Value> entry : scanner) {
      count++;
      assertEquals("denied", entry.getKey().getColumnFamily().toString());
    }
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.