%@ page
contentType="text/html; charset=UTF-8"
import="javax.servlet.*"
import="javax.servlet.http.*"
import="java.io.*"
import="java.net.URL"
import="org.apache.hadoop.mapred.*"
import="org.apache.hadoop.util.*"
%>
<%
String jobId = request.getParameter("jobid");
if (jobId == null) {
out.println("
Missing 'jobid' for fetching job configuration!
");
return;
}
%>
Job Configuration: JobId - <%= jobId %>
Job Configuration: JobId - <%= jobId %>
<%
JobTracker tracker = JobTracker.getTracker();
JobInProgress job = (JobInProgress)tracker.getJob(jobId);
if (job == null) {
out.print("Job '" + jobId + "' not found!
\n");
return;
}
JobStatus status = job.getStatus();
int runState = status.getRunState();
if (runState != JobStatus.RUNNING) {
out.print("Job '" + jobId + "' not running!
\n");
return;
}
try {
JobConf jobConf = job.getJobConf();
ByteArrayOutputStream jobConfXML = new ByteArrayOutputStream();
jobConf.write(jobConfXML);
XMLUtils.transform(
jobConf.getConfResourceAsInputStream("webapps/static/jobconf.xsl"),
new ByteArrayInputStream(jobConfXML.toByteArray()),
out
);
} catch (Exception e) {
out.println("Failed to retreive job configuration for job '" + jobId + "!");
out.println(e);
}
%>
Hadoop, 2006.