Author: ddas
Date: Wed Sep 17 03:26:47 2008
New Revision: 696228
URL: http://svn.apache.org/viewvc?rev=696228&view=rev
Log:
HADOOP-4125. Handles Reduce cleanup tip on the web ui. Contributed by
Amareshwari Sriramadasu.
Modified:
hadoop/core/trunk/CHANGES.txt
hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobInProgress.java
hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/ReduceTask.java
hadoop/core/trunk/src/webapps/job/taskdetails.jsp
Modified: hadoop/core/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=696228&r1=696227&r2=696228&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Wed Sep 17 03:26:47 2008
@@ -583,6 +583,9 @@
HADOOP-3623. Refactor LeaseManager. (szetszwo)
+ HADOOP-4125. Handles Reduce cleanup tip on the web ui.
+ (Amareshwari Sriramadasu via ddas)
+
Release 0.18.1 - 2008-09-17
IMPROVEMENTS
Modified:
hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobInProgress.java
URL:
http://svn.apache.org/viewvc/hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobInProgress.java?rev=696228&r1=696227&r2=696228&view=diff
==============================================================================
--- hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobInProgress.java
(original)
+++ hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobInProgress.java
Wed Sep 17 03:26:47 2008
@@ -2017,10 +2017,8 @@
*/
public synchronized TaskInProgress getTaskInProgress(TaskID tipid) {
if (tipid.isMap()) {
- for (int i = 0; i < cleanup.length; i++) {
- if (tipid.equals(cleanup[i].getTIPId())){
- return cleanup[i];
- }
+ if (tipid.getId() == maps.length) { // cleanup map tip
+ return cleanup[0];
}
for (int i = 0; i < maps.length; i++) {
if (tipid.equals(maps[i].getTIPId())){
@@ -2028,6 +2026,9 @@
}
}
} else {
+ if (tipid.getId() == reduces.length) { // cleanup reduce tip
+ return cleanup[1];
+ }
for (int i = 0; i < reduces.length; i++) {
if (tipid.equals(reduces[i].getTIPId())){
return reduces[i];
Modified: hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/ReduceTask.java
URL:
http://svn.apache.org/viewvc/hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/ReduceTask.java?rev=696228&r1=696227&r2=696228&view=diff
==============================================================================
--- hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/ReduceTask.java
(original)
+++ hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/ReduceTask.java Wed
Sep 17 03:26:47 2008
@@ -111,9 +111,9 @@
}
- private Progress copyPhase = getProgress().addPhase("copy");
- private Progress sortPhase = getProgress().addPhase("sort");
- private Progress reducePhase = getProgress().addPhase("reduce");
+ private Progress copyPhase;
+ private Progress sortPhase;
+ private Progress reducePhase;
private Counters.Counter reduceInputKeyCounter =
getCounters().findCounter(Counter.REDUCE_INPUT_GROUPS);
private Counters.Counter reduceInputValueCounter =
@@ -324,6 +324,11 @@
job.setBoolean("mapred.skip.on", isSkipping());
Reducer reducer = ReflectionUtils.newInstance(job.getReducerClass(), job);
+ if (!cleanupJob) {
+ copyPhase = getProgress().addPhase("copy");
+ sortPhase = getProgress().addPhase("sort");
+ reducePhase = getProgress().addPhase("reduce");
+ }
// start thread that will handle communication with parent
startCommunicationThread(umbilical);
final Reporter reporter = getReporter(umbilical);
Modified: hadoop/core/trunk/src/webapps/job/taskdetails.jsp
URL:
http://svn.apache.org/viewvc/hadoop/core/trunk/src/webapps/job/taskdetails.jsp?rev=696228&r1=696227&r2=696228&view=diff
==============================================================================
--- hadoop/core/trunk/src/webapps/job/taskdetails.jsp (original)
+++ hadoop/core/trunk/src/webapps/job/taskdetails.jsp Wed Sep 17 03:26:47 2008
@@ -70,6 +70,10 @@
}
TaskStatus[] ts = (job != null) ? tracker.getTaskStatuses(tipidObj)
: null;
+ boolean isCleanup = false;
+ if (tipidObj != null) {
+ isCleanup = job.getTaskInProgress(tipidObj).isCleanupTask();
+ }
%>
<[EMAIL PROTECTED] import="org.apache.hadoop.hdfs.server.namenode.JspHelper"%>
@@ -95,7 +99,7 @@
<table border=2 cellpadding="5" cellspacing="2">
<tr><td align="center">Task
Attempts</td><td>Machine</td><td>Status</td><td>Progress</td><td>Start
Time</td>
<%
- if (!ts[0].getIsMap()) {
+ if (!ts[0].getIsMap() && !isCleanup) {
%>
<td>Shuffle Finished</td><td>Sort Finished</td>
<%
@@ -123,7 +127,7 @@
out.print("<td>"
+ StringUtils.getFormattedTimeWithDiff(dateFormat, status
.getStartTime(), 0) + "</td>");
- if (!ts[i].getIsMap()) {
+ if (!ts[i].getIsMap() && !isCleanup) {
out.print("<td>"
+ StringUtils.getFormattedTimeWithDiff(dateFormat, status
.getShuffleFinishTime(), status.getStartTime()) + "</td>");