Examples of KeyExtent


Examples of org.apache.accumulo.core.data.KeyExtent

      }
    }

    // delete the clone markers and create directory entries
    Scanner mscanner = conn.createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS);
    mscanner.setRange(new KeyExtent(new Text(tableId), null, null).toMetadataRange());
    mscanner.fetchColumnFamily(Constants.METADATA_CLONED_COLUMN_FAMILY);

    int dirCount = 0;

    for (Entry<Key,Value> entry : mscanner) {
View Full Code Here

Examples of org.apache.accumulo.core.data.KeyExtent

    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) {
View Full Code Here

Examples of org.apache.accumulo.core.data.KeyExtent

    }

    public void fromBytes(byte bytes[]) throws IOException {
      DataInputBuffer inp = new DataInputBuffer();
      inp.reset(bytes, bytes.length);
      extent = new KeyExtent();
      extent.readFields(inp);
      timestamp = inp.readLong();
      server = inp.readUTF();
      filename = inp.readUTF();
      tabletId = inp.read();
View Full Code Here

Examples of org.apache.accumulo.core.data.KeyExtent

   
    findContainingTablets(opts);
  }

  private static void findContainingTablets(Opts opts) throws Exception {
    Range range = new KeyExtent(new Text(opts.tableId), null, null).toMetadataRange();

    Scanner scanner = opts.getConnector().createScanner("createEvents", opts.auths);
    scanner.setRange(range);

    Text row = new Text(opts.row);
    for (Entry<Key,Value> entry : scanner) {
      KeyExtent ke = new KeyExtent(entry.getKey().getRow(), new Value(TextUtil.getBytes(entry.getKey().getColumnFamily())));
      if (ke.contains(row)) {
        System.out.println(entry.getKey().getColumnQualifier() + " " + ke + " " + entry.getValue());
      }
    }
  }
View Full Code Here

Examples of org.apache.accumulo.core.data.KeyExtent

    public void map(LogFileKey key, LogFileValue value, Context context) throws IOException, InterruptedException {
      if (key.event == LogEvents.OPEN) {
        uuid = key.tserverSession;
      } else if (key.event == LogEvents.DEFINE_TABLET) {
        if (key.tablet.getTableId().toString().equals(Constants.METADATA_TABLE_ID)) {
          tabletIds.put(key.tid, new KeyExtent(key.tablet));
        }
      } else if ((key.event == LogEvents.MUTATION || key.event == LogEvents.MANY_MUTATIONS) && tabletIds.containsKey(key.tid)) {
        for (Mutation m : value.mutations) {
          index(context, m, uuid, tabletIds.get(key.tid));
        }
View Full Code Here

Examples of org.apache.accumulo.core.data.KeyExtent

      }
      total.numEntries += info.numEntries;
      TabletStatsKeeper.update(total.minors, info.minors);
      TabletStatsKeeper.update(total.majors, info.majors);
     
      KeyExtent extent = new KeyExtent(info.extent);
      String tableId = extent.getTableId().toString();
      MessageDigest digester = MessageDigest.getInstance("MD5");
      if (extent.getEndRow() != null && extent.getEndRow().getLength() > 0) {
        digester.update(extent.getEndRow().getBytes(), 0, extent.getEndRow().getLength());
      }
      String obscuredExtent = new String(Base64.encodeBase64(digester.digest()), Constants.UTF8);
      String displayExtent = String.format("<code>[%s]</code>", obscuredExtent);
     
      TableRow row = perTabletResults.prepareRow();
View Full Code Here

Examples of org.apache.accumulo.core.data.KeyExtent

        updateServerErrors(ase.getServer(), ase);
      } catch (AccumuloException ae) {
        // assume an IOError communicating with !METADATA tablet
        failedMutations.add(mutationsToProcess);
      } catch (AccumuloSecurityException e) {
        updateAuthorizationFailures(Collections.singletonMap(new KeyExtent(new Text(Constants.METADATA_TABLE_ID), null, null),
            SecurityErrorCode.valueOf(e.getSecurityErrorCode().name())));
      } catch (TableDeletedException e) {
        updateUnknownErrors(e.getMessage(), e);
      } catch (TableOfflineException e) {
        updateUnknownErrors(e.getMessage(), e);
View Full Code Here

Examples of org.apache.accumulo.core.data.KeyExtent

            updateAuthorizationFailures(Translator.translate(updateErrors.authorizationFailures, Translators.TKET));
           
            long totalCommitted = 0;
           
            for (Entry<KeyExtent,Long> entry : failures.entrySet()) {
              KeyExtent failedExtent = entry.getKey();
              int numCommitted = (int) (long) entry.getValue();
              totalCommitted += numCommitted;
             
              String table = failedExtent.getTableId().toString();
             
              TabletLocator.getInstance(instance, new Text(table)).invalidateCache(failedExtent);
             
              ArrayList<Mutation> mutations = (ArrayList<Mutation>) tabMuts.get(failedExtent);
              allFailures.addAll(table, mutations.subList(numCommitted, mutations.size()));
View Full Code Here

Examples of org.apache.accumulo.core.data.KeyExtent

  public abstract OT translate(IT input);
 
  public static class TKeyExtentTranslator extends Translator<TKeyExtent,KeyExtent> {
    @Override
    public KeyExtent translate(TKeyExtent input) {
      return new KeyExtent(input);
    }
View Full Code Here

Examples of org.apache.accumulo.core.data.KeyExtent

        end.append(new byte[] {'<'}, 0, 1);
        scanner.setRange(new Range(start, end));
        for (Iterator<Entry<Key,Value>> iterator = scanner.iterator(); iterator.hasNext();) {
          final Entry<Key,Value> next = iterator.next();
          if (Constants.METADATA_PREV_ROW_COLUMN.hasColumns(next.getKey())) {
            KeyExtent extent = new KeyExtent(next.getKey().getRow(), next.getValue());
            final String pr = encode(encode, extent.getPrevEndRow());
            final String er = encode(encode, extent.getEndRow());
            final String line = String.format("%-26s (%s, %s%s", obscuredTabletName(extent), pr == null ? "-inf" : pr, er == null ? "+inf" : er,
                er == null ? ") Default Tablet " : "]");
            p.print(line);
          }
        }
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.