Merge -r 1171900:1171901 from trunk to branch-0.23 to fix MAPREDUCE-2987.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1171902 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Arun Murthy 2011-09-17 05:53:28 +00:00
parent 1d12b70d0e
commit 9146f43c8d
4 changed files with 14 additions and 15 deletions

View File

@ -1304,6 +1304,9 @@ Release 0.23.0 - Unreleased
MAPREDUCE-3007. Fixed Yarn Mapreduce client to be able to connect to MAPREDUCE-3007. Fixed Yarn Mapreduce client to be able to connect to
JobHistoryServer in secure mode. (vinodkv) 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 Release 0.22.0 - Unreleased
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -27,6 +27,7 @@ import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.Configuration.IntegerRanges; import org.apache.hadoop.conf.Configuration.IntegerRanges;
import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.RawComparator; import org.apache.hadoop.io.RawComparator;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapreduce.InputFormat; import org.apache.hadoop.mapreduce.InputFormat;
import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.JobContext; import org.apache.hadoop.mapreduce.JobContext;
@ -60,7 +61,11 @@ public class JobContextImpl implements JobContext {
protected final Credentials credentials; protected final Credentials credentials;
public JobContextImpl(Configuration conf, JobID jobId) { 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.jobId = jobId;
this.credentials = this.conf.getCredentials(); this.credentials = this.conf.getCredentials();
try { try {

View File

@ -223,23 +223,10 @@ public class YARNRunner implements ClientProtocol {
throw new YarnException(e); 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 // Construct necessary information to start the MR AM
ApplicationSubmissionContext appContext = ApplicationSubmissionContext appContext =
createApplicationSubmissionContext(conf, jobSubmitDir, ts); createApplicationSubmissionContext(conf, jobSubmitDir, ts);
// XXX Remove
in.close();
// ---
// Submit to ResourceManager // Submit to ResourceManager
ApplicationId applicationId = resMgrDelegate.submitApplication(appContext); ApplicationId applicationId = resMgrDelegate.submitApplication(appContext);

View File

@ -23,10 +23,14 @@ import static org.apache.hadoop.yarn.webapp.Params.*;
public class HeaderBlock extends HtmlBlock { public class HeaderBlock extends HtmlBlock {
@Override protected void render(Block html) { @Override protected void render(Block html) {
String loggedIn = "";
if (request().getRemoteUser() != null) {
loggedIn = "Logged in as: " + request().getRemoteUser();
}
html. html.
div("#header.ui-widget"). div("#header.ui-widget").
div("#user"). div("#user").
_("Logged in as: "+ request().getRemoteUser())._(). _(loggedIn)._().
div("#logo"). div("#logo").
img("/static/hadoop-st.png")._(). img("/static/hadoop-st.png")._().
h1($(TITLE))._(); h1($(TITLE))._();