Author: acmurthy Date: Fri Nov 23 02:13:27 2007 New Revision: 597626 URL: http://svn.apache.org/viewvc?rev=597626&view=rev Log: HADOOP-2216. Fix jobtasks.jsp to ensure that it first collects the taskids which satisfy the filtering criteria and then use that list to print out only the required task-reports, previously it was oblivious to the filtering and hence used the wrong index into the array of task-reports. Contributed by Amar Kamat.
Modified: lucene/hadoop/trunk/CHANGES.txt lucene/hadoop/trunk/src/webapps/job/jobtasks.jsp Modified: lucene/hadoop/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?rev=597626&r1=597625&r2=597626&view=diff ============================================================================== --- lucene/hadoop/trunk/CHANGES.txt (original) +++ lucene/hadoop/trunk/CHANGES.txt Fri Nov 23 02:13:27 2007 @@ -143,6 +143,12 @@ incorporating the jobid. Also adds a test-case for JobControl vis-a-vis the LocalJobRunner. (Adrian Woodhead via acmurthy) + HADOOP-2216. Fix jobtasks.jsp to ensure that it first collects the + taskids which satisfy the filtering criteria and then use that list to + print out only the required task-reports, previously it was oblivious to + the filtering and hence used the wrong index into the array of task-reports. + (Amar Kamat via acmurthy) + Release 0.15.1 - 2007-11-27 Modified: lucene/hadoop/trunk/src/webapps/job/jobtasks.jsp URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/webapps/job/jobtasks.jsp?rev=597626&r1=597625&r2=597626&view=diff ============================================================================== --- lucene/hadoop/trunk/src/webapps/job/jobtasks.jsp (original) +++ lucene/hadoop/trunk/src/webapps/job/jobtasks.jsp Fri Nov 23 02:13:27 2007 @@ -57,17 +57,20 @@ } // Filtering the reports if some filter is specified if (!"all".equals(state)) { + List<String> filteredReportsTaskIds = new ArrayList<String>(); List<TaskReport> filteredReports = new ArrayList<TaskReport>(); - for (int i = 0; i < reports.length; ++i) { - if ("completed".equals(state) && tasks[i].isComplete()) { - filteredReports.add(reports[i]); - } else if ("running".equals(state) && tasks[i].isRunning()) { - filteredReports.add(reports[i]); - } else if ("killed".equals(state) && tasks[i].wasKilled()) { - filteredReports.add(reports[i]); - } else if ("pending".equals(state) - && !(tasks[i].isComplete() || tasks[i].isRunning() - || tasks[i].wasKilled())) { + for (int i = 0; i < tasks.length; ++i) { + if (("completed".equals(state) && tasks[i].isComplete()) + || ("running".equals(state) && tasks[i].isRunning()) + || ("killed".equals(state) && tasks[i].wasKilled()) + || ("pending".equals(state) && !(tasks[i].isComplete() + || tasks[i].isRunning() + || tasks[i].wasKilled()))) { + filteredReportsTaskIds.add(tasks[i].getTIPId()); + } + } + for (int i = 0 ; i < reports.length; ++i) { + if (filteredReportsTaskIds.contains(reports[i].getTaskId())) { filteredReports.add(reports[i]); } }