MAPREDUCE-5181. RMCommunicator should not use AMToken from the env. Contributed by Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1471816 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
be256a1819
commit
e96077aaf4
|
@ -350,6 +350,9 @@ Release 2.0.5-beta - UNRELEASED
|
||||||
MAPREDUCE-5166. Fix ConcurrentModificationException due to insufficient
|
MAPREDUCE-5166. Fix ConcurrentModificationException due to insufficient
|
||||||
synchronization on updates to task Counters. (Sandy Ryza via acmurthy)
|
synchronization on updates to task Counters. (Sandy Ryza via acmurthy)
|
||||||
|
|
||||||
|
MAPREDUCE-5181. RMCommunicator should not use AMToken from the env.
|
||||||
|
(Vinod Kumar Vavilapalli via sseth)
|
||||||
|
|
||||||
Release 2.0.4-alpha - UNRELEASED
|
Release 2.0.4-alpha - UNRELEASED
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -38,13 +38,9 @@ import org.apache.hadoop.mapreduce.v2.app.job.Job;
|
||||||
import org.apache.hadoop.mapreduce.v2.app.job.JobStateInternal;
|
import org.apache.hadoop.mapreduce.v2.app.job.JobStateInternal;
|
||||||
import org.apache.hadoop.mapreduce.v2.app.job.impl.JobImpl;
|
import org.apache.hadoop.mapreduce.v2.app.job.impl.JobImpl;
|
||||||
import org.apache.hadoop.mapreduce.v2.jobhistory.JobHistoryUtils;
|
import org.apache.hadoop.mapreduce.v2.jobhistory.JobHistoryUtils;
|
||||||
import org.apache.hadoop.security.SecurityUtil;
|
|
||||||
import org.apache.hadoop.security.UserGroupInformation;
|
import org.apache.hadoop.security.UserGroupInformation;
|
||||||
import org.apache.hadoop.security.token.Token;
|
|
||||||
import org.apache.hadoop.security.token.TokenIdentifier;
|
|
||||||
import org.apache.hadoop.yarn.YarnException;
|
import org.apache.hadoop.yarn.YarnException;
|
||||||
import org.apache.hadoop.yarn.api.AMRMProtocol;
|
import org.apache.hadoop.yarn.api.AMRMProtocol;
|
||||||
import org.apache.hadoop.yarn.api.ApplicationConstants;
|
|
||||||
import org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterRequest;
|
import org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterRequest;
|
||||||
import org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest;
|
import org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest;
|
||||||
import org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterResponse;
|
import org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterResponse;
|
||||||
|
@ -280,24 +276,7 @@ public abstract class RMCommunicator extends AbstractService
|
||||||
throw new YarnException(e);
|
throw new YarnException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UserGroupInformation.isSecurityEnabled()) {
|
// CurrentUser should already have AMToken loaded.
|
||||||
String tokenURLEncodedStr = System.getenv().get(
|
|
||||||
ApplicationConstants.APPLICATION_MASTER_TOKEN_ENV_NAME);
|
|
||||||
Token<? extends TokenIdentifier> token = new Token<TokenIdentifier>();
|
|
||||||
|
|
||||||
try {
|
|
||||||
token.decodeFromUrlString(tokenURLEncodedStr);
|
|
||||||
} catch (IOException e) {
|
|
||||||
throw new YarnException(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
SecurityUtil.setTokenService(token, serviceAddr);
|
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("AppMasterToken is " + token);
|
|
||||||
}
|
|
||||||
currentUser.addToken(token);
|
|
||||||
}
|
|
||||||
|
|
||||||
return currentUser.doAs(new PrivilegedAction<AMRMProtocol>() {
|
return currentUser.doAs(new PrivilegedAction<AMRMProtocol>() {
|
||||||
@Override
|
@Override
|
||||||
public AMRMProtocol run() {
|
public AMRMProtocol run() {
|
||||||
|
|
Loading…
Reference in New Issue