diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index daf9b4095f6..c013beac58c 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -1304,6 +1304,9 @@ Release 0.23.0 - Unreleased MAPREDUCE-3007. Fixed Yarn Mapreduce client to be able to connect to JobHistoryServer in secure mode. (vinodkv) + MAPREDUCE-2987. Fixed display of logged user on RM Web-UI. (Thomas Graves + via acmurthy) + Release 0.22.0 - Unreleased INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/task/JobContextImpl.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/task/JobContextImpl.java index 85cdaf07be4..1cf2f4ea5ae 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/task/JobContextImpl.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/task/JobContextImpl.java @@ -27,6 +27,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configuration.IntegerRanges; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.RawComparator; +import org.apache.hadoop.mapred.JobConf; import org.apache.hadoop.mapreduce.InputFormat; import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.mapreduce.JobContext; @@ -60,7 +61,11 @@ public class JobContextImpl implements JobContext { protected final Credentials credentials; public JobContextImpl(Configuration conf, JobID jobId) { - this.conf = new org.apache.hadoop.mapred.JobConf(conf); + if (conf instanceof JobConf) { + this.conf = (JobConf)conf; + } else { + this.conf = new org.apache.hadoop.mapred.JobConf(conf); + } this.jobId = jobId; this.credentials = this.conf.getCredentials(); try { diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java index 37516460103..ff59b0bb448 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java @@ -223,23 +223,10 @@ public class YARNRunner implements ClientProtocol { throw new YarnException(e); } - // XXX Remove - Path submitJobDir = new Path(jobSubmitDir); - FileContext defaultFS = FileContext.getFileContext(conf); - Path submitJobFile = - defaultFS.makeQualified(JobSubmissionFiles.getJobConfPath(submitJobDir)); - FSDataInputStream in = defaultFS.open(submitJobFile); - conf.addResource(in); - // --- - // Construct necessary information to start the MR AM ApplicationSubmissionContext appContext = createApplicationSubmissionContext(conf, jobSubmitDir, ts); - // XXX Remove - in.close(); - // --- - // Submit to ResourceManager ApplicationId applicationId = resMgrDelegate.submitApplication(appContext); diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/view/HeaderBlock.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/view/HeaderBlock.java index d03d2d24d92..ee305a6f84f 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/view/HeaderBlock.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/view/HeaderBlock.java @@ -23,10 +23,14 @@ import static org.apache.hadoop.yarn.webapp.Params.*; public class HeaderBlock extends HtmlBlock { @Override protected void render(Block html) { + String loggedIn = ""; + if (request().getRemoteUser() != null) { + loggedIn = "Logged in as: " + request().getRemoteUser(); + } html. div("#header.ui-widget"). div("#user"). - _("Logged in as: "+ request().getRemoteUser())._(). + _(loggedIn)._(). div("#logo"). img("/static/hadoop-st.png")._(). h1($(TITLE))._();