You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nutch.apache.org by mc...@apache.org on 2005/06/29 17:59:28 UTC
svn commit: r202396 - in /lucene/nutch/branches/mapred: ./ bin/
src/java/org/apache/nutch/mapred/ src/webapps/jobtracker/
Author: mc
Date: Wed Jun 29 08:59:28 2005
New Revision: 202396
URL: http://svn.apache.org/viewcvs?rev=202396&view=rev
Log:
Fix JobTrackerInfoServer so it can find JSP resources,
compile them, etc.
Modified:
lucene/nutch/branches/mapred/bin/nutch
lucene/nutch/branches/mapred/build.xml
lucene/nutch/branches/mapred/default.properties
lucene/nutch/branches/mapred/src/java/org/apache/nutch/mapred/JobTracker.java
lucene/nutch/branches/mapred/src/java/org/apache/nutch/mapred/JobTrackerInfoServer.java
lucene/nutch/branches/mapred/src/webapps/jobtracker/jobdetails.jsp
lucene/nutch/branches/mapred/src/webapps/jobtracker/jobtracker.jsp
Modified: lucene/nutch/branches/mapred/bin/nutch
URL: http://svn.apache.org/viewcvs/lucene/nutch/branches/mapred/bin/nutch?rev=202396&r1=202395&r2=202396&view=diff
==============================================================================
--- lucene/nutch/branches/mapred/bin/nutch (original)
+++ lucene/nutch/branches/mapred/bin/nutch Wed Jun 29 08:59:28 2005
@@ -82,6 +82,7 @@
# CLASSPATH initially contains $NUTCH_CONF_DIR, or defaults to $NUTCH_HOME/conf
CLASSPATH=${NUTCH_CONF_DIR:=$NUTCH_HOME/conf}
+CLASSPATH=${CLASSPATH}:$JAVA_HOME/lib/tools.jar
# for developers, add Nutch classes to CLASSPATH
if [ -d "$NUTCH_HOME/build/classes" ]; then
Modified: lucene/nutch/branches/mapred/build.xml
URL: http://svn.apache.org/viewcvs/lucene/nutch/branches/mapred/build.xml?rev=202396&r1=202395&r2=202396&view=diff
==============================================================================
--- lucene/nutch/branches/mapred/build.xml (original)
+++ lucene/nutch/branches/mapred/build.xml Wed Jun 29 08:59:28 2005
@@ -38,6 +38,7 @@
<target name="init">
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.classes}"/>
+ <mkdir dir="${build.webapps}"/>
<mkdir dir="${test.build.dir}"/>
<mkdir dir="${test.build.classes}"/>
@@ -45,6 +46,10 @@
<touch datetime="01/25/1971 2:00 pm">
<fileset dir="${conf.dir}" includes="**/*.template"/>
</touch>
+
+ <copy todir="${build.webapps}/jobtracker">
+ <fileset dir="${src.webapps}/jobtracker"/>
+ </copy>
<copy todir="${conf.dir}" verbose="true">
<fileset dir="${conf.dir}" includes="**/*.template"/>
Modified: lucene/nutch/branches/mapred/default.properties
URL: http://svn.apache.org/viewcvs/lucene/nutch/branches/mapred/default.properties?rev=202396&r1=202395&r2=202396&view=diff
==============================================================================
--- lucene/nutch/branches/mapred/default.properties (original)
+++ lucene/nutch/branches/mapred/default.properties Wed Jun 29 08:59:28 2005
@@ -15,6 +15,7 @@
build.dir = ./build
build.classes = ${build.dir}/classes
+build.webapps = ${build.dir}/webapps
build.plugins = ${build.dir}/plugins
build.docs = ${build.dir}/docs
build.javadoc = ${build.docs}/api
@@ -29,6 +30,7 @@
javacc.home=/usr/java/javacc
web.src.dir = ./src/web
+src.webapps = ./src/webapps
javadoc.link.java=http://java.sun.com/j2se/1.4.2/docs/api/
javadoc.link.lucene=http://jakarta.apache.org/lucene/docs/api/
Modified: lucene/nutch/branches/mapred/src/java/org/apache/nutch/mapred/JobTracker.java
URL: http://svn.apache.org/viewcvs/lucene/nutch/branches/mapred/src/java/org/apache/nutch/mapred/JobTracker.java?rev=202396&r1=202395&r2=202396&view=diff
==============================================================================
--- lucene/nutch/branches/mapred/src/java/org/apache/nutch/mapred/JobTracker.java (original)
+++ lucene/nutch/branches/mapred/src/java/org/apache/nutch/mapred/JobTracker.java Wed Jun 29 08:59:28 2005
@@ -231,8 +231,14 @@
this.port = addr.getPort();
this.interTrackerServer = RPC.getServer(this, addr.getPort());
this.interTrackerServer.start();
-// this.infoServer = new JobTrackerInfoServer(this, TRACKERINFO_PORT);
-// this.infoServer.start();
+ Properties p = System.getProperties();
+ for (Iterator it = p.keySet().iterator(); it.hasNext(); ) {
+ String key = (String) it.next();
+ String val = (String) p.getProperty(key);
+ LOG.info("Property '" + key + "' is " + val);
+ }
+ this.infoServer = new JobTrackerInfoServer(this, TRACKERINFO_PORT);
+ this.infoServer.start();
this.startTime = System.currentTimeMillis();
Modified: lucene/nutch/branches/mapred/src/java/org/apache/nutch/mapred/JobTrackerInfoServer.java
URL: http://svn.apache.org/viewcvs/lucene/nutch/branches/mapred/src/java/org/apache/nutch/mapred/JobTrackerInfoServer.java?rev=202396&r1=202395&r2=202396&view=diff
==============================================================================
--- lucene/nutch/branches/mapred/src/java/org/apache/nutch/mapred/JobTrackerInfoServer.java (original)
+++ lucene/nutch/branches/mapred/src/java/org/apache/nutch/mapred/JobTrackerInfoServer.java Wed Jun 29 08:59:28 2005
@@ -59,10 +59,21 @@
* We need the jobTracker to grab stats, and the port to
* know where to listen.
*/
+ private static final boolean WINDOWS = System.getProperty("os.name").startsWith("Windows");
public JobTrackerInfoServer(JobTracker jobTracker, int port) throws IOException {
this.jobTracker = jobTracker;
this.server = new org.mortbay.jetty.Server();
- WebApplicationContext context = server.addWebApplication(null, "/", "src/webapps/jobtracker");
+ URL url = JobTrackerInfoServer.class.getClassLoader().getResource("webapps");
+ String path = url.getPath();
+ if (WINDOWS && path.startsWith("/")) {
+ path = path.substring(1);
+ try {
+ path = URLDecoder.decode(path, "UTF-8");
+ } catch (UnsupportedEncodingException e) {
+ }
+ }
+ File jobtracker = new File(path, "jobtracker");
+ WebApplicationContext context = server.addWebApplication(null, "/", jobtracker.getCanonicalPath());
SocketListener socketListener = new SocketListener();
socketListener.setPort(port);
Modified: lucene/nutch/branches/mapred/src/webapps/jobtracker/jobdetails.jsp
URL: http://svn.apache.org/viewcvs/lucene/nutch/branches/mapred/src/webapps/jobtracker/jobdetails.jsp?rev=202396&r1=202395&r2=202396&view=diff
==============================================================================
--- lucene/nutch/branches/mapred/src/webapps/jobtracker/jobdetails.jsp (original)
+++ lucene/nutch/branches/mapred/src/webapps/jobtracker/jobdetails.jsp Wed Jun 29 08:59:28 2005
@@ -4,7 +4,7 @@
import="javax.servlet.http.*"
import="java.io.*"
import="java.util.*"
- import="org.apache.nutch.mapReduce.*"
+ import="org.apache.nutch.mapred.*"
%>
<%
String jobid = request.getParameter("jobid");
Modified: lucene/nutch/branches/mapred/src/webapps/jobtracker/jobtracker.jsp
URL: http://svn.apache.org/viewcvs/lucene/nutch/branches/mapred/src/webapps/jobtracker/jobtracker.jsp?rev=202396&r1=202395&r2=202396&view=diff
==============================================================================
--- lucene/nutch/branches/mapred/src/webapps/jobtracker/jobtracker.jsp (original)
+++ lucene/nutch/branches/mapred/src/webapps/jobtracker/jobtracker.jsp Wed Jun 29 08:59:28 2005
@@ -4,7 +4,7 @@
import="javax.servlet.http.*"
import="java.io.*"
import="java.util.*"
- import="org.apache.nutch.mapReduce.*"
+ import="org.apache.nutch.mapred.*"
%>
<%!
JobTracker tracker = JobTracker.getTracker();