hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r1668784 - /hama/trunk/core/src/main/java/org/apache/hama/bsp/BSPJobClient.java
Date Tue, 24 Mar 2015 03:40:29 GMT
Author: edwardyoon
Date: Tue Mar 24 03:40:28 2015
New Revision: 1668784

URL: http://svn.apache.org/r1668784
Log:
Minor changes

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=1668784&r1=1668783&r2=1668784&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 Tue Mar 24 03:40:28
2015
@@ -303,16 +303,22 @@ public class BSPJobClient extends Config
     BSPJob job = pJob;
     job.setJobID(jobId);
 
-    int maxTasks = job.getConfiguration().getInt(Constants.MAX_TASKS_PER_JOB,
+    int maxTasks;
+    int configured = job.getConfiguration().getInt(Constants.MAX_TASKS_PER_JOB,
         job.getNumBspTask());
 
     ClusterStatus clusterStatus = getClusterStatus(true);
     // Re-adjust the maxTasks based on cluster status.
-    if (clusterStatus != null
-        && maxTasks > (clusterStatus.getMaxTasks() - clusterStatus.getTasks()))
{
-      LOG.warn("The configured number of tasks has exceeded the maximum allowed. Job will
run with "
-          + (clusterStatus.getMaxTasks() - clusterStatus.getTasks()) + " tasks.");
-      job.setNumBspTask(clusterStatus.getMaxTasks() - clusterStatus.getTasks());
+    if (clusterStatus != null) {
+      maxTasks = clusterStatus.getMaxTasks() - clusterStatus.getTasks();
+
+      if (configured > maxTasks) {
+        LOG.warn("The configured number of tasks has exceeded the maximum allowed. Job will
run with "
+            + (maxTasks) + " tasks.");
+        job.setNumBspTask(maxTasks);
+      }
+    } else {
+      maxTasks = configured;
     }
 
     Path submitJobDir = new Path(getSystemDir(), "submit_"



Mime
View raw message