Package org.apache.accumulo.core.client

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


    }
   
    private KeyExtent getHighTablet(KeyExtent range) throws AccumuloException {
      try {
        Connector conn = getConnector();
        Scanner scanner = conn.createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS);
        ColumnFQ.fetch(scanner, Constants.METADATA_PREV_ROW_COLUMN);
        KeyExtent start = new KeyExtent(range.getTableId(), range.getEndRow(), null);
        scanner.setRange(new Range(start.getMetadataEntry(), null));
        Iterator<Entry<Key,Value>> iterator = scanner.iterator();
        if (!iterator.hasNext()) {
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);
      ColumnFQ.fetch(scanner, Constants.METADATA_PREV_ROW_COLUMN);
      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

 
  @Override
  public void run() throws Exception {
    Connector connector = getConnector();
    for (int i = 0; i < 100000; i++) {
      connector.createScanner("mscant", Constants.NO_AUTHS);
    }
  }
 
}
View Full Code Here

    Mutation m = new Mutation(last);
    m.put("cf", "cq", "v");
    bw.addMutation(m);
    bw.flush();
   
    Scanner scanner = conn.createScanner(table, Constants.NO_AUTHS);
    scanner.setRange(new Range(last));
   
    bw.close();
   
    long time = scanner.iterator().next().getKey().getTimestamp();
View Full Code Here

  public static void main(String[] args) throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
    Opts opts = new Opts();
    opts.parseArgs(VerifyIngest.class.getName(), args);
   
    Connector connector = opts.getConnector();
    Scanner scanner = connector.createScanner(opts.tableName, opts.auths);
   
    scanner.setRange(new Range(new Text(String.format("row_%08d", opts.startRow)), null));
   
    Iterator<Entry<Key,Value>> si = scanner.iterator();
   
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

      bw.addMutation(nm(String.format("r%05d", i)));
    }
   
    bw.close();
   
    Scanner scanner = conn.createScanner("foo", Constants.NO_AUTHS);
   
    ArrayList<Text> rows = new ArrayList<Text>();
   
    for (Entry<Key,Value> entry : scanner) {
      rows.add(entry.getKey().getRow());
View Full Code Here

    for (Entry<Key,Value> entry : scanner) {
      rows.add(entry.getKey().getRow());
    }
   
    for (int i = rows.size() - 1; i > 0; i--) {
      Text max = FindMax.findMax(conn.createScanner("foo", Constants.NO_AUTHS), null, true, rows.get(i), false);
      assertEquals(rows.get(i - 1), max);
     
      max = FindMax.findMax(conn.createScanner("foo", Constants.NO_AUTHS), rows.get(i - 1), true, rows.get(i), false);
      assertEquals(rows.get(i - 1), max);
     
View Full Code Here

   
    for (int i = rows.size() - 1; i > 0; i--) {
      Text max = FindMax.findMax(conn.createScanner("foo", Constants.NO_AUTHS), null, true, rows.get(i), false);
      assertEquals(rows.get(i - 1), max);
     
      max = FindMax.findMax(conn.createScanner("foo", Constants.NO_AUTHS), rows.get(i - 1), true, rows.get(i), false);
      assertEquals(rows.get(i - 1), max);
     
      max = FindMax.findMax(conn.createScanner("foo", Constants.NO_AUTHS), rows.get(i - 1), false, rows.get(i), false);
      assertNull(max);
     
View Full Code Here

      assertEquals(rows.get(i - 1), max);
     
      max = FindMax.findMax(conn.createScanner("foo", Constants.NO_AUTHS), rows.get(i - 1), true, rows.get(i), false);
      assertEquals(rows.get(i - 1), max);
     
      max = FindMax.findMax(conn.createScanner("foo", Constants.NO_AUTHS), rows.get(i - 1), false, rows.get(i), false);
      assertNull(max);
     
      max = FindMax.findMax(conn.createScanner("foo", Constants.NO_AUTHS), null, true, rows.get(i), true);
      assertEquals(rows.get(i), max);
     
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.