hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r1403152 - /hama/trunk/core/src/main/java/org/apache/hama/bsp/BSPJobClient.java
Date Mon, 29 Oct 2012 03:33:35 GMT
Author: edwardyoon
Date: Mon Oct 29 03:33:35 2012
New Revision: 1403152

URL: http://svn.apache.org/viewvc?rev=1403152&view=rev
Log:
To avoid creation of unnecessary job files on dfs, move exceeded exception to the top.

Modified:
    hama/trunk/core/src/main/java/org/apache/hama/bsp/BSPJobClient.java

Modified: hama/trunk/core/src/main/java/org/apache/hama/bsp/BSPJobClient.java
URL: http://svn.apache.org/viewvc/hama/trunk/core/src/main/java/org/apache/hama/bsp/BSPJobClient.java?rev=1403152&r1=1403151&r2=1403152&view=diff
==============================================================================
--- hama/trunk/core/src/main/java/org/apache/hama/bsp/BSPJobClient.java (original)
+++ hama/trunk/core/src/main/java/org/apache/hama/bsp/BSPJobClient.java Mon Oct 29 03:33:35
2012
@@ -301,6 +301,13 @@ public class BSPJobClient extends Config
     BSPJob job = pJob;
     job.setJobID(jobId);
 
+    ClusterStatus clusterStatus = getClusterStatus(true);
+    int maxTasks = clusterStatus.getMaxTasks() - clusterStatus.getTasks();
+    
+    if (maxTasks < job.getNumBspTask()) {
+      throw new IOException("Job failed! No more taks slots available");
+    }
+    
     Path submitJobDir = new Path(getSystemDir(), "submit_"
         + Integer.toString(Math.abs(r.nextInt()), 36));
     Path submitSplitFile = new Path(submitJobDir, "job.split");
@@ -318,13 +325,6 @@ public class BSPJobClient extends Config
     fs.mkdirs(submitJobDir);
     short replication = (short) job.getInt("bsp.submit.replication", 10);
 
-    ClusterStatus clusterStatus = getClusterStatus(true);
-    int maxTasks = clusterStatus.getMaxTasks() - clusterStatus.getTasks();
-    if (maxTasks < job.getNumBspTask()) {
-      LOG.error("Job failed! No more taks slots available");
-      System.exit(-1);
-    }
-
     // only create the splits if we have an input
     if (job.get("bsp.input.dir") != null) {
       // Create the splits for the job



Mime
View raw message