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

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


  @Test
  public void testImport() throws Throwable {
    ImportTestFilesAndData dataAndFiles = prepareTestFiles();
    Instance instance = new MockInstance("foo");
    Connector connector = instance.getConnector(new AuthInfo("user", ByteBuffer
        .wrap(new byte[0]), "foo"));
    TableOperations tableOperations = connector.tableOperations();
    tableOperations.create("a_table");
    tableOperations.importDirectory("a_table",
        dataAndFiles.importPath.toString(),
View Full Code Here


  }

  @Test(expected = TableNotFoundException.class)
  public void testFailsWithNoTable() throws Throwable {
    Instance instance = new MockInstance("foo");
    Connector connector = instance.getConnector(new AuthInfo("user", ByteBuffer
        .wrap(new byte[0]), "foo"));
    TableOperations tableOperations = connector.tableOperations();
    ImportTestFilesAndData testFiles = prepareTestFiles();
    tableOperations.importDirectory("doesnt_exist_table",
        testFiles.importPath.toString(), testFiles.failurePath.toString(),
View Full Code Here

  }

  @Test(expected = IOException.class)
  public void testFailsWithNonEmptyFailureDirectory() throws Throwable {
    Instance instance = new MockInstance("foo");
    Connector connector = instance.getConnector(new AuthInfo("user", ByteBuffer
        .wrap(new byte[0]), "foo"));
    TableOperations tableOperations = connector.tableOperations();
    ImportTestFilesAndData testFiles = prepareTestFiles();
    FileSystem fs = testFiles.failurePath.getFileSystem(new Configuration());
    fs.open(testFiles.failurePath.suffix("/something")).close();
View Full Code Here

    this.instance = instance;
   
    // copy password so that user can clear it.... in future versions we can clear it...
    byte[] passCopy = new byte[password.length];
    System.arraycopy(password, 0, passCopy, 0, password.length);
    this.credentials = new AuthInfo(user, ByteBuffer.wrap(password), instance.getInstanceID());
   
    // hardcoded string for SYSTEM user since the definition is
    // in server code
    if (!user.equals("!SYSTEM")) {
      ServerClient.execute(instance, new ClientExec<ClientService.Iface>() {
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

        } 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

    byte[] pass = password.getBytes();
    shellState.getConnector().securityOperations().changeUserPassword(user, pass);
    // update the current credentials if the password changed was for
    // the current user
    if (shellState.getConnector().whoami().equals(user))
      shellState.updateUser(new AuthInfo(user, ByteBuffer.wrap(pass), shellState.getConnector().getInstance().getInstanceID()));
    Shell.log.debug("Changed password for user " + user);
    return 0;
  }
View Full Code Here

  private String getInstanceName() {
    return instanceName;
  }
 
  protected AuthInfo getCredentials() {
    return new AuthInfo(getUsername(), ByteBuffer.wrap(getPassword().getBytes()), getInstance().getInstanceID());
  }
View Full Code Here

      cl = p.parse(opts, args);
    } catch (ParseException e1) {
      System.out.println("Parse Exception, exiting.");
      return;
    }
    credentials = new AuthInfo(cl.getOptionValue("username", "root"), ByteBuffer.wrap(cl.getOptionValue("password", "secret").getBytes()), HdfsZooInstance
        .getInstance().getInstanceID());
   
    try {
      long deleted = 0;
     
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.