Package org.apache.accumulo.core.client

Examples of org.apache.accumulo.core.client.Connector.createScanner()


    Entry<Key,Value> entry : scanner) {
      count++;
    }
    assertEquals(1, count);
    count = 0;
    scanner = c.createScanner("b", Constants.NO_AUTHS);
    for (@SuppressWarnings("unused")
    Entry<Key,Value> entry : scanner) {
      count++;
    }
    assertEquals(1, count);
View Full Code Here


      bw.addMutation(m);
    }
   
    bw.close();
   
    Scanner scanner = c.createScanner("test", Constants.NO_AUTHS);
   
    Entry<Key,Value> entry = scanner.iterator().next();
   
    assertEquals("9", entry.getValue().toString());
   
View Full Code Here

    ClientOpts opts = new ClientOpts();
    opts.parseArgs(LocalityCheck.class.getName(), args);
   
    FileSystem fs = FileSystem.get(CachedConfiguration.getInstance());
    Connector connector = opts.getConnector();
    Scanner scanner = connector.createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS);
    scanner.fetchColumnFamily(Constants.METADATA_CURRENT_LOCATION_COLUMN_FAMILY);
    scanner.fetchColumnFamily(Constants.METADATA_DATAFILE_COLUMN_FAMILY);
    scanner.setRange(Constants.METADATA_KEYSPACE);
   
    Map<String,Long> totalBlocks = new HashMap<String,Long>();
View Full Code Here

      bw.addMutation(m);
    }
    IteratorSetting is = new IteratorSetting(40, SummingRowFilter.class);
    conn.tableOperations().attachIterator("table1", is);

    Scanner scanner = conn.createScanner("table1", Constants.NO_AUTHS);
    assertEquals(new HashSet<String>(Arrays.asList("2", "3")), getRows(scanner));

    scanner.fetchColumn(new Text("cf1"), new Text("cq2"));
    assertEquals(new HashSet<String>(Arrays.asList("1", "3")), getRows(scanner));
View Full Code Here

    for (Mutation m : createMutations()) {
      bw.addMutation(m);
    }
    conn.tableOperations().attachIterator("chained_row_filters", new IteratorSetting(40, "trueFilter1", TrueFilter.class));
    conn.tableOperations().attachIterator("chained_row_filters", new IteratorSetting(41, "trueFilter2", TrueFilter.class));
    Scanner scanner = conn.createScanner("chained_row_filters", Constants.NO_AUTHS);
    assertEquals(new HashSet<String>(Arrays.asList("0", "1", "2", "3", "4")), getRows(scanner));
  }

  @Test
  public void testFilterConjunction() throws Exception {
View Full Code Here

    for (Mutation m : createMutations()) {
      bw.addMutation(m);
    }
    conn.tableOperations().attachIterator("filter_conjunction", new IteratorSetting(40, "rowZeroOrOne", RowZeroOrOneFilter.class));
    conn.tableOperations().attachIterator("filter_conjunction", new IteratorSetting(41, "rowOneOrTwo", RowOneOrTwoFilter.class));
    Scanner scanner = conn.createScanner("filter_conjunction", Constants.NO_AUTHS);
    assertEquals(new HashSet<String>(Arrays.asList("1")), getRows(scanner));
  }

  @Test
  public void deepCopyCopiesTheSource() throws Exception {
View Full Code Here

          String tokenClass = token.getClass().getCanonicalName();
          ByteBuffer tokenBuffer = ByteBuffer.wrap(CredentialHelper.toBytes(token));
          scanner = new OfflineScanner(instance, new TCredentials(principal, tokenClass, tokenBuffer, instance.getInstanceID()), Tables.getTableId(instance,
              table), authorizations);
        } else {
          scanner = conn.createScanner(table, authorizations);
        }
        if (isIsolated) {
          log.info("Creating isolated scanner");
          scanner = new IsolatedScanner(scanner);
        }
View Full Code Here

      if (opts != null && opts.isSetAuthorizations()) {
        auth = getAuthorizations(opts.authorizations);
      } else {
        auth = connector.securityOperations().getUserAuthorizations(connector.whoami());
      }
      Scanner scanner = connector.createScanner(tableName, auth);
     
      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());
View Full Code Here

        startRow = range.getStartKey().getRow();
      else
        startRow = new Text();

      Range metadataRange = new Range(new KeyExtent(new Text(tableId), startRow, null).getMetadataEntry(), true, null, false);
      Scanner scanner = conn.createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS);
      Constants.METADATA_PREV_ROW_COLUMN.fetch(scanner);
      scanner.fetchColumnFamily(Constants.METADATA_LAST_LOCATION_COLUMN_FAMILY);
      scanner.fetchColumnFamily(Constants.METADATA_CURRENT_LOCATION_COLUMN_FAMILY);
      scanner.fetchColumnFamily(Constants.METADATA_FUTURE_LOCATION_COLUMN_FAMILY);
      scanner.setRange(metadataRange);
View Full Code Here

        startRow = range.getStartKey().getRow();
      else
        startRow = new Text();

      Range metadataRange = new Range(new KeyExtent(new Text(tableId), startRow, null).getMetadataEntry(), true, null, false);
      Scanner scanner = conn.createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS);
      Constants.METADATA_PREV_ROW_COLUMN.fetch(scanner);
      scanner.fetchColumnFamily(Constants.METADATA_LAST_LOCATION_COLUMN_FAMILY);
      scanner.fetchColumnFamily(Constants.METADATA_CURRENT_LOCATION_COLUMN_FAMILY);
      scanner.fetchColumnFamily(Constants.METADATA_FUTURE_LOCATION_COLUMN_FAMILY);
      scanner.setRange(metadataRange);
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.