appAttemptID.toString());
UserGroupInformation currentUser = UserGroupInformation.getCurrentUser();
Credentials credentials =
currentUser.getCredentials();
DataOutputBuffer dob = new DataOutputBuffer();
credentials.writeTokenStorageToStream(dob);
dob.close();
// Now remove the AM->RM token so that containers cannot access it.
Iterator<Token<?>> iter = credentials.getAllTokens().iterator();
while (iter.hasNext()) {
Token<?> token = iter.next();
log.info("Token {}", token.getKind());
if (token.getKind().equals(AMRMTokenIdentifier.KIND_NAME)) {
iter.remove();
}
}
allTokens = ByteBuffer.wrap(dob.getData(), 0, dob.getLength());
// set up secret manager
secretManager = new ClientToAMTokenSecretManager(appAttemptID, null);
// if not a secure cluster, extract the username -it will be