Package org.apache.hadoop.security

Examples of org.apache.hadoop.security.Credentials.addToken()


    Credentials ts = new Credentials();
    // get the delegation tokens
    MyToken token1 = dfs.getDelegationToken(new Text("user1"));

    String nn1 = DelegationTokenRenewer.SCHEME + "://host1:0";
    ts.addToken(new Text(nn1), token1);

    // register the tokens for renewal
    ApplicationId applicationId_0 =  BuilderUtils.newApplicationId(0, 0);
    localDtr.addApplication(applicationId_0, ts, true);
    localDtr.applicationFinished(applicationId_0);
View Full Code Here


    Credentials ts = new Credentials();
    // get the delegation tokens
    MyToken token1 = dfs.getDelegationToken(new Text("user1"));
   
    String nn1 = DelegationTokenRenewer.SCHEME + "://host1:0";
    ts.addToken(new Text(nn1), token1);

    // register the tokens for renewal
    ApplicationId applicationId_0 =  BuilderUtils.newApplicationId(0, 0);
    localDtr.addApplication(applicationId_0, ts, true);
    localDtr.applicationFinished(applicationId_0);
View Full Code Here

    String nnAddress =
      InetAddress.getByName(uri.getHost()).getHostAddress() + ":" + uri.getPort();
    token.setService(new Text(nnAddress));
   
    Credentials ts = new Credentials();
    ts.addToken(new Text(shortName), token);
    ts.writeTokenStorageToStream(out);
  }

  /**
   * Utility method to obtain a delegation token over http
View Full Code Here

    String nn3 = DelegationTokenRenewal.SCHEME + "://host3:0";
   
    Credentials ts = new Credentials();
   
    // register the token for renewal
    ts.addToken(new Text(nn1), token1);
    ts.addToken(new Text(nn2), token2);
    ts.addToken(new Text(nn3), token3);
   
    // register the tokens for renewal
    DelegationTokenRenewal.registerDelegationTokensForRenewal(
View Full Code Here

   
    Credentials ts = new Credentials();
   
    // register the token for renewal
    ts.addToken(new Text(nn1), token1);
    ts.addToken(new Text(nn2), token2);
    ts.addToken(new Text(nn3), token3);
   
    // register the tokens for renewal
    DelegationTokenRenewal.registerDelegationTokensForRenewal(
        new JobID("job1", 1), ts, conf);
View Full Code Here

    Credentials ts = new Credentials();
   
    // register the token for renewal
    ts.addToken(new Text(nn1), token1);
    ts.addToken(new Text(nn2), token2);
    ts.addToken(new Text(nn3), token3);
   
    // register the tokens for renewal
    DelegationTokenRenewal.registerDelegationTokensForRenewal(
        new JobID("job1", 1), ts, conf);
    // first 3 initial renewals + 1 real
View Full Code Here

    //to cause this one to be set for renew in 2 secs
    dfs.setTokenToRenewIn2Sec(token4);
    System.out.println("token="+token4+" should be renewed for 2 secs");
   
    String nn4 = DelegationTokenRenewal.SCHEME + "://host4:0";
    ts.addToken(new Text(nn4), token4);
   

    JobID jid2 = new JobID("job2",1);
    DelegationTokenRenewal.registerDelegationTokensForRenewal(jid2, ts, conf);
    DelegationTokenRenewal.removeDelegationTokenRenewalForJob(jid2);
View Full Code Here

        Credentials cred1 = new Credentials();
        Credentials cred2 = new Credentials();
        TokenCache.obtainTokensForNamenodesInternal(cred1, new Path[] { p1 },
            job.getConfiguration());
        for (Token<? extends TokenIdentifier> t : cred1.getAllTokens()) {
          cred2.addToken(new Text("Hdfs"), t);
        }
        DataOutputStream os = new DataOutputStream(new FileOutputStream(
            binaryTokenFileName.toString()));
        cred2.writeTokenStorageToStream(os);
        os.close();
View Full Code Here

    String nn3 = DelegationTokenRenewal.SCHEME + "://host3:0";
   
    Credentials ts = new Credentials();
   
    // register the token for renewal
    ts.addToken(new Text(nn1), token1);
    ts.addToken(new Text(nn2), token2);
    ts.addToken(new Text(nn3), token3);
   
    // register the tokens for renewal
    DelegationTokenRenewal.registerDelegationTokensForRenewal(
View Full Code Here

   
    Credentials ts = new Credentials();
   
    // register the token for renewal
    ts.addToken(new Text(nn1), token1);
    ts.addToken(new Text(nn2), token2);
    ts.addToken(new Text(nn3), token3);
   
    // register the tokens for renewal
    DelegationTokenRenewal.registerDelegationTokensForRenewal(
        new JobID("job1", 1), ts, conf);
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.