You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by om...@apache.org on 2011/03/04 05:38:43 UTC
svn commit: r1077634 - in
/hadoop/common/branches/branch-0.20-security-patches: build.xml
src/core/org/apache/hadoop/http/HttpServer.java
src/mapred/org/apache/hadoop/mapred/JobHistoryServer.java
Author: omalley
Date: Fri Mar 4 04:38:43 2011
New Revision: 1077634
URL: http://svn.apache.org/viewvc?rev=1077634&view=rev
Log:
commit 9c826d78f94fc390539ac6ac17ba184ac495ec26
Author: Arun C Murthy <ac...@apache.org>
Date: Tue Aug 3 15:36:54 2010 -0700
MAPREDUCE-291. Fixed packaging of job-history. Contributed by Srikanth Sundarrajan.
Modified:
hadoop/common/branches/branch-0.20-security-patches/build.xml
hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/http/HttpServer.java
hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobHistoryServer.java
Modified: hadoop/common/branches/branch-0.20-security-patches/build.xml
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/build.xml?rev=1077634&r1=1077633&r2=1077634&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/build.xml (original)
+++ hadoop/common/branches/branch-0.20-security-patches/build.xml Fri Mar 4 04:38:43 2011
@@ -436,18 +436,24 @@
webxml="${build.webapps}/task/WEB-INF/web.xml">
</jsp-compile>
+ <!-- Compile Java files (excluding JSPs) checking warnings -->
<jsp-compile
- uriroot="${src.webapps}/job"
+ uriroot="${src.webapps}/history"
outputdir="${build.src}"
package="org.apache.hadoop.mapred"
- webxml="${build.webapps}/job/WEB-INF/web.xml">
+ webxml="${build.webapps}/history/WEB-INF/web.xml">
</jsp-compile>
-
+
+ <copy todir="${build.webapps}/job">
+ <fileset dir="${src.webapps}/job" includes="**/*.jsp"/>
+ <fileset dir="${src.webapps}/history" includes="**/*.jsp"/>
+ </copy>
+
<jsp-compile
- uriroot="${src.webapps}/history"
+ uriroot="${build.webapps}/job"
outputdir="${build.src}"
package="org.apache.hadoop.mapred"
- webxml="${build.webapps}/history/WEB-INF/web.xml">
+ webxml="${build.webapps}/job/WEB-INF/web.xml">
</jsp-compile>
<!-- Compile Java files (excluding JSPs) checking warnings -->
Modified: hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/http/HttpServer.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/http/HttpServer.java?rev=1077634&r1=1077633&r2=1077634&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/http/HttpServer.java (original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/core/org/apache/hadoop/http/HttpServer.java Fri Mar 4 04:38:43 2011
@@ -267,36 +267,6 @@ public class HttpServer implements Filte
defaultContexts.put(ctxt, isFiltered);
}
- public WebAppContext addContext(String name, boolean isFiltered)
- throws IOException {
- if (0 == webServer.getHandlers().length) {
- throw new RuntimeException("Couldn't find handler");
- }
- WebAppContext webAppCtx = new WebAppContext();
- webAppCtx.setDisplayName("AppContext-" + name);
- webAppCtx.setContextPath("/" + name);
- webAppCtx.setWar(getWebAppsPath() + "/" + name);
- setContextAttributes(webAppCtx);
- addContext(webAppCtx, isFiltered);
-
- if (isFiltered) {
- defineFilter(webAppCtx, "krb5Filter",
- Krb5AndCertsSslSocketConnector.Krb5SslFilter.class.getName(),
- null, null);
-
- defineFilter(webAppCtx, "safety", QuotingInputFilter.class.getName(), null,
- new String[] {"/*"});
-
- final FilterInitializer[] initializers = getFilterInitializers(conf);
- if (initializers != null) {
- for(FilterInitializer c : initializers) {
- c.initFilter(this, conf);
- }
- }
- }
- return webAppCtx;
- }
-
/**
* Add a context
* @param pathSpec The path spec for the context
Modified: hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobHistoryServer.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobHistoryServer.java?rev=1077634&r1=1077633&r2=1077634&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobHistoryServer.java (original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobHistoryServer.java Fri Mar 4 04:38:43 2011
@@ -167,19 +167,11 @@ public class JobHistoryServer {
JobHistory.getCompletedJobHistoryLocation().toString();
FileSystem historyFS = new Path(historyLogDir).getFileSystem(conf);
- context = historyServer.addContext("history", true);
+ historyServer.setAttribute("historyLogDir", historyLogDir);
+ historyServer.setAttribute("fileSys", historyFS);
+ historyServer.setAttribute("jobConf", conf);
+ historyServer.setAttribute("aclManager", aclsManager);
- historyServer.setAttribute(context, "historyLogDir", historyLogDir);
- historyServer.setAttribute(context, "fileSys", historyFS);
- historyServer.setAttribute(context, "jobConf", conf);
- historyServer.setAttribute(context, "aclManager", aclsManager);
-
- if (!isEmbedded(conf)) {
- historyServer.setAttribute("historyLogDir", historyLogDir);
- historyServer.setAttribute("fileSys", historyFS);
- historyServer.setAttribute("jobConf", conf);
- historyServer.setAttribute("aclManager", aclsManager);
- }
historyServer.addServlet("historyfile", "/historyfile",
RawHistoryFileServlet.class);
}
@@ -189,19 +181,13 @@ public class JobHistoryServer {
throws IOException {
InetSocketAddress infoSocAddr = NetUtils.createSocketAddr(historyInfoAddr);
int tmpInfoPort = infoSocAddr.getPort();
- return new HttpServer("/", infoSocAddr.getHostName(),
+ return new HttpServer("history", infoSocAddr.getHostName(),
tmpInfoPort, tmpInfoPort == 0, conf, aclsManager.getAdminsAcl());
}
public void start() throws IOException {
if (!isEmbedded(conf)) {
historyServer.start();
- } else {
- try {
- context.start();
- } catch (Exception e) {
- throw new IOException("Unable to start history context", e);
- }
}
InetSocketAddress infoSocAddr = NetUtils.createSocketAddr(historyInfoAddr);
@@ -252,8 +238,7 @@ public class JobHistoryServer {
}
static String getHistoryUrlPrefix(JobConf conf) {
- return (isEmbedded(conf) ? "" : "http://" + getAddress(conf))
- + "/history";
+ return (isEmbedded(conf) ? "" : "http://" + getAddress(conf));
}
private static String getBindAddress(JobConf conf) {