MAPREDUCE-5319. Set user.name in job.xml. Contributed by Xuan Gong.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1492962 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Arun Murthy 2013-06-14 06:26:55 +00:00
parent aa14698fd6
commit 2166fa201e
2 changed files with 5 additions and 0 deletions

View File

@ -555,6 +555,8 @@ Release 2.1.0-beta - UNRELEASED
MAPREDUCE-5298. Moved MapReduce services to YARN-530 stricter lifecycle. MAPREDUCE-5298. Moved MapReduce services to YARN-530 stricter lifecycle.
(Steve Loughran via vinodkv) (Steve Loughran via vinodkv)
MAPREDUCE-5319. Set user.name in job.xml. (Xuan Gong via acmurthy)
Release 2.0.5-alpha - 06/06/2013 Release 2.0.5-alpha - 06/06/2013
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -53,6 +53,7 @@ import org.apache.hadoop.mapreduce.protocol.ClientProtocol;
import org.apache.hadoop.mapreduce.security.TokenCache; import org.apache.hadoop.mapreduce.security.TokenCache;
import org.apache.hadoop.mapreduce.split.JobSplitWriter; import org.apache.hadoop.mapreduce.split.JobSplitWriter;
import org.apache.hadoop.security.Credentials; import org.apache.hadoop.security.Credentials;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.security.authorize.AccessControlList; import org.apache.hadoop.security.authorize.AccessControlList;
import org.apache.hadoop.security.token.Token; import org.apache.hadoop.security.token.Token;
import org.apache.hadoop.util.ReflectionUtils; import org.apache.hadoop.util.ReflectionUtils;
@ -354,6 +355,8 @@ class JobSubmitter {
Path submitJobDir = new Path(jobStagingArea, jobId.toString()); Path submitJobDir = new Path(jobStagingArea, jobId.toString());
JobStatus status = null; JobStatus status = null;
try { try {
conf.set(MRJobConfig.USER_NAME,
UserGroupInformation.getCurrentUser().getShortUserName());
conf.set("hadoop.http.filter.initializers", conf.set("hadoop.http.filter.initializers",
"org.apache.hadoop.yarn.server.webproxy.amfilter.AmFilterInitializer"); "org.apache.hadoop.yarn.server.webproxy.amfilter.AmFilterInitializer");
conf.set(MRJobConfig.MAPREDUCE_JOB_DIR, submitJobDir.toString()); conf.set(MRJobConfig.MAPREDUCE_JOB_DIR, submitJobDir.toString());