Package org.apache.accumulo.core.security.thrift

Examples of org.apache.accumulo.core.security.thrift.AuthInfo


        } else
          initiateMinor = true;
      }
     
      if (updateMetadata) {
        AuthInfo creds = SecurityConstants.getSystemCredentials();
        // if multiple threads were allowed to update this outside of a sync block, then it would be
        // a race condition
        MetadataTable.updateTabletFlushID(extent, tableFlushID, creds, tabletServer.getLock());
      } else if (initiateMinor)
        initiateMinorCompaction(tableFlushID);
View Full Code Here


          dfv.setTime(bulkTime);
        }
      }
     
      synchronized (bulkFileImportLock) {
        AuthInfo auths = SecurityConstants.getSystemCredentials();
        Connector conn;
        try {
          conn = HdfsZooInstance.getInstance().getConnector(auths.user, auths.password);
        } catch (Exception ex) {
          throw new IOException(ex);
View Full Code Here

      try {
        // the order of writing to !METADATA and walog is important in the face of machine/process failures
        // need to write to !METADATA before writing to walog, when things are done in the reverse order
        // data could be lost... the minor compaction start even should be written before the following metadata
        // write is made
        AuthInfo creds = SecurityConstants.getSystemCredentials();
       
        synchronized (timeLock) {
          if (commitSession.getMaxCommittedTime() > persistedTime)
            persistedTime = commitSession.getMaxCommittedTime();
         
View Full Code Here

    public static AuthInfo fromByteArray(byte[] serializedCredential) throws AccumuloSecurityException {
        if (serializedCredential == null)
            return null;
        TDeserializer td = new TDeserializer();
        try {
            AuthInfo toRet = new AuthInfo();
            td.deserialize(toRet, serializedCredential);
            return toRet;
        } catch (TException e) {
            // This really shouldn't happen
            throw new AccumuloSecurityException("unknown", SecurityErrorCode.DEFAULT_SECURITY_ERROR, e);
View Full Code Here

        pkey.getTimestamp());
  }


  public static ByteBuffer encodeUserPrincipal(String principal, String token, String instanceId) throws AccumuloSecurityException {
    return ByteBuffer.wrap(CredentialHelper.asByteArray(new AuthInfo(principal, ByteBuffer.wrap(token.getBytes()), instanceId)));
  }
View Full Code Here

   
    writerCache = CacheBuilder.newBuilder().expireAfterAccess(10, TimeUnit.MINUTES).maximumSize(1000).removalListener(new CloseWriter()).build();
  }
 
  protected Connector getConnector(ByteBuffer login) throws Exception {
    AuthInfo user = CredentialHelper.fromByteArray(ByteBufferUtil.toBytes(login));
    if (user == null)
      throw new org.apache.accumulo.proxy.thrift.AccumuloSecurityException("unknown user");
    Connector connector = instance.getConnector(user.getUser(), user.getPassword());
    return connector;
  }
View Full Code Here

     * I thought I could move files that have no file references in the table. However its possible a clone references a file. Therefore only move files that
     * have no loaded markers.
     */

    // determine which failed files were loaded
    AuthInfo creds = SecurityConstants.getSystemCredentials();
    Connector conn = HdfsZooInstance.getInstance().getConnector(creds.user, creds.password);
    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);
   
View Full Code Here

    MigrationCleanupThread migrationCleanupThread = new MigrationCleanupThread();
    migrationCleanupThread.start();
   
    tserverSet.startListeningForTabletServerChanges();
   
    AuthInfo systemAuths = SecurityConstants.getSystemCredentials();
    final TabletStateStore stores[] = {new ZooTabletStateStore(new ZooStore(zroot)), new RootTabletStateStore(instance, systemAuths, this),
        new MetaDataStateStore(instance, systemAuths, this)};
    watchers.add(new TabletGroupWatcher(stores[2], null));
    watchers.add(new TabletGroupWatcher(stores[1], watchers.get(0)));
    watchers.add(new TabletGroupWatcher(stores[0], watchers.get(1)));
View Full Code Here

    log.debug("removing the bulk processing flag file in " + bulk);
    Path bulkDir = new Path(bulk);
    MetadataTable.removeBulkLoadInProgressFlag("/" + bulkDir.getParent().getName() + "/" + bulkDir.getName());
    MetadataTable.addDeleteEntry(tableId, "/" + bulkDir.getName());
    log.debug("removing the metadata table markers for loaded files");
    AuthInfo creds = SecurityConstants.getSystemCredentials();
    Connector conn = HdfsZooInstance.getInstance().getConnector(creds.user, creds.password);
    MetadataTable.removeBulkLoadEntries(conn, tableId, tid);
    log.debug("releasing HDFS reservations for " + source + " and " + error);
    Utils.unreserveHdfsDirectory(source, tid);
    Utils.unreserveHdfsDirectory(error, tid);
View Full Code Here

      return new MockTabletLocator();
    Instance instance = getInstance(conf);
    String username = getUsername(conf);
    byte[] password = getPassword(conf);
    String tableName = getTablename(conf);
    return TabletLocator.getInstance(instance, new AuthInfo(username, ByteBuffer.wrap(password), instance.getInstanceID()),
        new Text(Tables.getTableId(instance, tableName)));
  }
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.security.thrift.AuthInfo

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.