Examples of readTokenStorageStream()


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

    // now read the data back in and verify correct values
    Credentials ts = new Credentials();
    DataInputStream dis =
      new DataInputStream(new ByteArrayInputStream(baos.toByteArray()));
   
    ts.readTokenStorageStream(dis);
    Token<? extends TokenIdentifier> newToken = ts.getToken(new Text(SHORT_NAME));
   
    assertEquals("Should only be one token in storage", ts.numberOfTokens(), 1);
    assertEquals("Service value should have survived",
        "127.0.0.1:2005", newToken.getService().toString());
View Full Code Here

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

    Credentials credentials = new Credentials();
    DataInputByteBuffer dibb = new DataInputByteBuffer();
    ByteBuffer tokens = application.getAMContainerSpec().getTokens();
    if (tokens != null) {
      dibb.reset(tokens);
      credentials.readTokenStorageStream(dibb);
      tokens.rewind();
    }
    return credentials;
  }
 
View Full Code Here

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

    // Try to read the old credentials.
    Credentials credentials = new Credentials();
    if (credentialsLocation.exists()) {
      DataInputStream is = new DataInputStream(new BufferedInputStream(credentialsLocation.getInputStream()));
      try {
        credentials.readTokenStorageStream(is);
      } finally {
        is.close();
      }
    }
View Full Code Here

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

    if (tokens != null) {
      DataInputByteBuffer buf = new DataInputByteBuffer();
      tokens.rewind();
      buf.reset(tokens);
      try {
        credentials.readTokenStorageStream(buf);
        if (LOG.isDebugEnabled()) {
          for (Token<? extends TokenIdentifier> tk : credentials.getAllTokens()) {
            LOG.debug(tk.getService() + " = " + tk.toString());
          }
        }
View Full Code Here

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

        Credentials credentials = null;
        if (attemptStateData.getAppAttemptTokens() != null) {
          credentials = new Credentials();
          DataInputByteBuffer dibb = new DataInputByteBuffer();
          dibb.reset(attemptStateData.getAppAttemptTokens());
          credentials.readTokenStorageStream(dibb);
        }

        ApplicationAttemptState attemptState =
            new ApplicationAttemptState(attemptId,
              attemptStateData.getMasterContainer(), credentials,
View Full Code Here

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

    Assert.assertEquals("ACLs mismatch", acls, launchCtx.getApplicationACLs());
    Credentials launchCredentials = new Credentials();

    DataInputByteBuffer dibb = new DataInputByteBuffer();
    dibb.reset(launchCtx.getTokens());
    launchCredentials.readTokenStorageStream(dibb);

    // verify all tokens specified for the task attempt are in the launch context
    for (Token<? extends TokenIdentifier> token : credentials.getAllTokens()) {
      Token<? extends TokenIdentifier> launchToken =
          launchCredentials.getToken(token.getService());
View Full Code Here

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

    Credentials credentials = new Credentials();
    DataInputByteBuffer dibb = new DataInputByteBuffer();
    ByteBuffer tokens = clc.getTokens();
    if (tokens != null) {
      dibb.reset(tokens);
      credentials.readTokenStorageStream(dibb);
      tokens.rewind();
    }
    // If the timeline delegation token is already in the CLC, no need to add
    // one more
    for (org.apache.hadoop.security.token.Token<? extends TokenIdentifier> token : credentials
View Full Code Here

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

    Credentials credentials = null;
    if(attemptStateData.getAppAttemptTokens() != null){
      DataInputByteBuffer dibb = new DataInputByteBuffer();
      credentials = new Credentials();
      dibb.reset(attemptStateData.getAppAttemptTokens());
      credentials.readTokenStorageStream(dibb);
    }
    ApplicationAttemptState attemptState =
        new ApplicationAttemptState(appAttemptId,
          attemptStateData.getMasterContainer(), credentials,
          attemptStateData.getStartTime());
View Full Code Here

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

    Credentials credentials = null;
    if (attemptStateData.getAppAttemptTokens() != null) {
      DataInputByteBuffer dibb = new DataInputByteBuffer();
      credentials = new Credentials();
      dibb.reset(attemptStateData.getAppAttemptTokens());
      credentials.readTokenStorageStream(dibb);
    }
    ApplicationAttemptState updatedAttemptState =
        new ApplicationAttemptState(appAttemptId,
          attemptStateData.getMasterContainer(), credentials,
          attemptStateData.getStartTime(), attemptStateData.getState(),
View Full Code Here

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

    credentials = new Credentials();
    DataInputByteBuffer dibb = new DataInputByteBuffer();
    tokens = clc.getTokens();
    if (tokens != null) {
      dibb.reset(tokens);
      credentials.readTokenStorageStream(dibb);
      tokens.rewind();
    }
    Collection<Token<? extends TokenIdentifier>> dTokens =
        credentials.getAllTokens();
    Assert.assertEquals(1, dTokens.size());
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.