فهرست منبع

Merge -r 604450:604451 from trunk to 0.15 branch. Fixes HADOOP-2228.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/branches/branch-0.15@604452 13f79535-47bb-0310-9956-ffa450edef68
Devaraj Das 17 سال پیش
والد
کامیت
e2680bd933
2فایلهای تغییر یافته به همراه11 افزوده شده و 2 حذف شده
  1. 4 0
      CHANGES.txt
  2. 7 2
      src/java/org/apache/hadoop/mapred/JobTracker.java

+ 4 - 0
CHANGES.txt

@@ -18,6 +18,10 @@ Branch 0.15 (unreleased)
     HADOOP-2378.  Fixes a problem where the last task completion event would
     get created after the job completes. (Alejandro Abdelnur via ddas)
 
+    HADOOP-2228.  Checks whether a job with a certain jobId is already running
+    and then tries to create the JobInProgress object. 
+    (Johan Oskarsson via ddas)
+
   IMPROVEMENTS
 
     HADOOP-2160.  Remove project-level, non-user documentation from

+ 7 - 2
src/java/org/apache/hadoop/mapred/JobTracker.java

@@ -1525,10 +1525,15 @@ public class JobTracker implements MRConstants, InterTrackerProtocol, JobSubmiss
    * asynchronously to handle split-computation and build up
    * the right TaskTracker/Block mapping.
    */
-  public synchronized JobStatus submitJob(String jobFile) throws IOException {
+  public synchronized JobStatus submitJob(String jobId) throws IOException {
     ensureRunning();
+    if(jobs.containsKey(jobId)) {
+      //job already running, don't start twice
+      return jobs.get(jobId).getStatus();
+    }
+    
     totalSubmissions++;
-    JobInProgress job = new JobInProgress(jobFile, this, this.conf);
+    JobInProgress job = new JobInProgress(jobId, this, this.conf);
     synchronized (jobs) {
       synchronized (jobsByPriority) {
         synchronized (jobInitQueue) {