Package org.apache.accumulo.core.client

Examples of org.apache.accumulo.core.client.IsolatedScanner$RowBufferingIterator


    }
    return m;
  }
 
  private static Scanner createCloneScanner(String tableId, Connector conn) throws TableNotFoundException {
    Scanner mscanner = new IsolatedScanner(conn.createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS));
    mscanner.setRange(new KeyExtent(new Text(tableId), null, null).toMetadataRange());
    mscanner.fetchColumnFamily(Constants.METADATA_DATAFILE_COLUMN_FAMILY);
    mscanner.fetchColumnFamily(Constants.METADATA_CURRENT_LOCATION_COLUMN_FAMILY);
    mscanner.fetchColumnFamily(Constants.METADATA_LAST_LOCATION_COLUMN_FAMILY);
    mscanner.fetchColumnFamily(Constants.METADATA_CLONED_COLUMN_FAMILY);
    Constants.METADATA_PREV_ROW_COLUMN.fetch(mscanner);
    Constants.METADATA_TIME_COLUMN.fetch(mscanner);
    return mscanner;
  }
View Full Code Here


    Constants.METADATA_CHOPPED_COLUMN.put(m, new Value("chopped".getBytes()));
    update(SecurityConstants.getSystemCredentials(), zooLock, m);
  }
 
  public static void removeBulkLoadEntries(Connector conn, String tableId, long tid) throws Exception {
    Scanner mscanner = new IsolatedScanner(conn.createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS));
    mscanner.setRange(new KeyExtent(new Text(tableId), null, null).toMetadataRange());
    mscanner.fetchColumnFamily(Constants.METADATA_BULKFILE_COLUMN_FAMILY);
    BatchWriter bw = conn.createBatchWriter(Constants.METADATA_TABLE_NAME, new BatchWriterConfig());
    for (Entry<Key,Value> entry : mscanner) {
      log.debug("Looking at entry " + entry + " with tid " + tid);
      if (Long.parseLong(entry.getValue().toString()) == tid) {
        log.debug("deleting entry " + entry);
View Full Code Here

  }
 
  public static List<String> getBulkFilesLoaded(Connector conn, KeyExtent extent, long tid) {
    List<String> result = new ArrayList<String>();
    try {
      Scanner mscanner = new IsolatedScanner(conn.createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS));
      mscanner.setRange(extent.toMetadataRange());
      mscanner.fetchColumnFamily(Constants.METADATA_BULKFILE_COLUMN_FAMILY);
      for (Entry<Key,Value> entry : mscanner) {
        if (Long.parseLong(entry.getValue().toString()) == tid) {
          result.add(entry.getKey().getColumnQualifier().toString());
        }
      }
View Full Code Here

      throw new ThriftTableOperationException(tableId, null, TableOperation.COMPACT, TableOperationExceptionType.OTHER, "Compaction canceled");
    }

    MapCounter<TServerInstance> serversToFlush = new MapCounter<TServerInstance>();
    Connector conn = master.getConnector();
    Scanner scanner = new IsolatedScanner(conn.createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS));
   
    Range range = new KeyExtent(new Text(tableId), null, startRow == null ? null : new Text(startRow)).toMetadataRange();
   
    if (tableId.equals(Constants.METADATA_TABLE_ID))
      range = range.clip(new Range(Constants.ROOT_TABLET_EXTENT.getMetadataEntry(), false, null, true));
   
    scanner.setRange(range);
    Constants.METADATA_COMPACT_COLUMN.fetch(scanner);
    Constants.METADATA_DIRECTORY_COLUMN.fetch(scanner);
    scanner.fetchColumnFamily(Constants.METADATA_CURRENT_LOCATION_COLUMN_FAMILY);
   
    long t1 = System.currentTimeMillis();
    RowIterator ri = new RowIterator(scanner);
   
    int tabletsToWaitFor = 0;
View Full Code Here

        } else {
          scanner = conn.createScanner(getInputTableName(job), authorizations);
        }
        if (isIsolated(job)) {
          log.info("Creating isolated scanner");
          scanner = new IsolatedScanner(scanner);
        }
        if (usesLocalIterators(job)) {
          log.info("Using local iterators");
          scanner = new ClientSideIteratorScanner(scanner);
        }
View Full Code Here

        } else {
          scanner = conn.createScanner(getInputTableName(attempt), authorizations);
        }
        if (isIsolated(attempt)) {
          log.info("Creating isolated scanner");
          scanner = new IsolatedScanner(scanner);
        }
        if (usesLocalIterators(attempt)) {
          log.info("Using local iterators");
          scanner = new ClientSideIteratorScanner(scanner);
        }
View Full Code Here

     * have no loaded markers.
     */

    // determine which failed files were loaded
    Connector conn = master.getConnector();
    Scanner mscanner = new IsolatedScanner(conn.createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS));
    mscanner.setRange(new KeyExtent(new Text(tableId), null, null).toMetadataRange());
    mscanner.fetchColumnFamily(Constants.METADATA_BULKFILE_COLUMN_FAMILY);
   
    for (Entry<Key,Value> entry : mscanner) {
      if (Long.parseLong(entry.getValue().toString()) == tid) {
        String loadedFile = entry.getKey().getColumnQualifier().toString();
        String absPath = failures.remove(loadedFile);
View Full Code Here

    List<String> tableNames = (List<String>) state.get("tables");
   
    String tableName = tableNames.get(rand.nextInt(tableNames.size()));
   
    try {
      RowIterator iter = new RowIterator(new IsolatedScanner(conn.createScanner(tableName, Constants.NO_AUTHS)));
     
      while (iter.hasNext()) {
        PeekingIterator<Entry<Key,Value>> row = new PeekingIterator<Entry<Key,Value>>(iter.next());
        Entry<Key,Value> kv = null;
        if (row.hasNext())
View Full Code Here

    Text row = Merge.getRandomRow(rand);
    log.info("Checking " + row);
    String user = state.getConnector().whoami();
    Authorizations auths = state.getConnector().securityOperations().getUserAuthorizations(user);
    Scanner scanner = state.getConnector().createScanner(Setup.getTableName(), auths);
    scanner = new IsolatedScanner(scanner);
    scanner.setRange(new Range(row));
    scanner.fetchColumnFamily(BulkPlusOne.CHECK_COLUMN_FAMILY);
    Value v = null;
    Key first = null;
    for (Entry<Key,Value> entry : scanner) {
View Full Code Here

    @Override
    public void run() {
      try {
        Random rand = new Random();

        Scanner scanner = new IsolatedScanner(conn.createScanner(table, Authorizations.EMPTY));

        for (int i = 0; i < 20; i++) {
          int numRows = rand.nextInt(10) + 1;

          ArrayList<ByteSequence> changes = new ArrayList<ByteSequence>(numRows);
          ArrayList<ConditionalMutation> mutations = new ArrayList<ConditionalMutation>();

          for (int j = 0; j < numRows; j++)
            changes.add(rows.get(rand.nextInt(rows.size())));

          for (ByteSequence row : changes) {
            scanner.setRange(new Range(row.toString()));
            Stats stats = new Stats(scanner.iterator());
            stats.set(rand.nextInt(10), rand.nextInt(Integer.MAX_VALUE));
            mutations.add(stats.toMutation());
          }

          ArrayList<ByteSequence> changed = new ArrayList<ByteSequence>(numRows);
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.client.IsolatedScanner$RowBufferingIterator

Copyright © 2018 www.massapicom. 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.