Преглед изворни кода

HADOOP-3087. Fixes a problem to do with refreshing of loadHistory.jsp. Contributed by Amareshwari Sriramadasu.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@641793 13f79535-47bb-0310-9956-ffa450edef68
Devaraj Das пре 17 година
родитељ
комит
66ae4bc38f
2 измењених фајлова са 10 додато и 1 уклоњено
  1. 3 0
      CHANGES.txt
  2. 7 1
      src/webapps/job/loadhistory.jsp

+ 3 - 0
CHANGES.txt

@@ -383,6 +383,9 @@ Trunk (unreleased changes)
     HADOOP-3073. close() on SocketInputStream or SocketOutputStream should
     close the underlying channel. (rangadi)
 
+    HADOOP-3087. Fixes a problem to do with refreshing of loadHistory.jsp.
+    (Amareshwari Sriramadasu via ddas)
+
 Release 0.16.2 - Unreleased
 
   BUG FIXES

+ 7 - 1
src/webapps/job/loadhistory.jsp

@@ -20,7 +20,13 @@
     String jobId =  (String)request.getParameter("jobid");
     JobHistory.JobInfo job = (JobHistory.JobInfo)
                                request.getSession().getAttribute("job");
-    if (null != job && (!jobId.equals(job.get(Keys.JOBID)))) {
+    // if session attribute of JobInfo exists and is of different job's,
+    // then remove the attribute
+    // if the job has not yet finished, remove the attribute sothat it 
+    // gets refreshed.
+    if (null != job && 
+       (!jobId.equals(job.get(Keys.JOBID)) 
+         || job.get(Keys.JOB_STATUS) == "")) {
       // remove jobInfo from session, keep only one job in session at a time
       request.getSession().removeAttribute("job"); 
       job = null ;