hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r1100148 - in /incubator/hama/trunk: ./ src/java/org/apache/hama/bsp/ src/java/org/apache/hama/util/ src/test/org/apache/hama/ src/test/org/apache/hama/bsp/
Date Fri, 06 May 2011 09:25:45 GMT
Author: edwardyoon
Date: Fri May  6 09:25:44 2011
New Revision: 1100148

URL: http://svn.apache.org/viewvc?rev=1100148&view=rev
Log:
Setting default values to job.setNumBspTask()

Removed:
    incubator/hama/trunk/src/test/org/apache/hama/bsp/TestSerializePrinting.java
Modified:
    incubator/hama/trunk/CHANGES.txt
    incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPJobClient.java
    incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPMaster.java
    incubator/hama/trunk/src/java/org/apache/hama/bsp/LocalBSPRunner.java
    incubator/hama/trunk/src/java/org/apache/hama/util/VersionInfo.java
    incubator/hama/trunk/src/test/org/apache/hama/HamaClusterTestCase.java
    incubator/hama/trunk/src/test/org/apache/hama/bsp/TestBSPMasterGroomServer.java

Modified: incubator/hama/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/CHANGES.txt?rev=1100148&r1=1100147&r2=1100148&view=diff
==============================================================================
--- incubator/hama/trunk/CHANGES.txt (original)
+++ incubator/hama/trunk/CHANGES.txt Fri May  6 09:25:44 2011
@@ -11,6 +11,7 @@ Release 0.3 - Unreleased
 
   IMPROVEMENTS
 
+    HAMA-379: Setting default values to job.setNumBspTask() (Thomas Jungblut via edwardyoon)
     HAMA-376: Refactor BSPMaster and GroomServer (ChiaHung Lin via edwardyoon)
     HAMA-382: Refactor HAMA POM (Tommaso Teofili)
     HAMA-362: Re-design a new data structure of BSPMessage (Thomas Jungblut via edwardyoon)
  

Modified: incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPJobClient.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPJobClient.java?rev=1100148&r1=1100147&r2=1100148&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPJobClient.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPJobClient.java Fri May  6 09:25:44
2011
@@ -294,6 +294,18 @@ public class BSPJobClient extends Config
      */
     UnixUserGroupInformation ugi = getUGI(job.getConf());
 
+    ClusterStatus clusterStatus = getClusterStatus(true);
+
+    // check the number of BSP tasks
+    int tasks = job.getNumBspTask();
+    int maxTasks = clusterStatus.getMaxTasks();
+    
+    if (tasks <= 0 || tasks > maxTasks) {
+      LOG.warn("The number of tasks you've entered was invalid. Using default value of "
+          + maxTasks + "!");
+      job.setNumBspTask(maxTasks);
+    }
+
     // Create a number of filenames in the BSPMaster's fs namespace
     FileSystem fs = getFs();
     fs.delete(submitJobDir, true);

Modified: incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPMaster.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPMaster.java?rev=1100148&r1=1100147&r2=1100148&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPMaster.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPMaster.java Fri May  6 09:25:44 2011
@@ -500,6 +500,10 @@ public class BSPMaster implements JobSub
         groomPeersMap.put(s.getGroomName(), s.getPeerName());
       }
     }
+    
+    // TODO currently we only have one task slot per groom server
+    this.totalTaskCapacity = numGroomServers;
+    
     if (detailed) {
       return new ClusterStatus(groomPeersMap, totalTasks, totalTaskCapacity,
           state);

Modified: incubator/hama/trunk/src/java/org/apache/hama/bsp/LocalBSPRunner.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/bsp/LocalBSPRunner.java?rev=1100148&r1=1100147&r2=1100148&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/bsp/LocalBSPRunner.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/bsp/LocalBSPRunner.java Fri May  6 09:25:44
2011
@@ -122,7 +122,7 @@ public class LocalBSPRunner implements J
     for (Entry<String, BSPPeerProtocol> entry : localGrooms.entrySet()) {
       map.put(entry.getKey(), entry.getValue().getPeerName());
     }
-    return new ClusterStatus(map, 0, 1, State.RUNNING);
+    return new ClusterStatus(map, threadPoolSize, threadPoolSize, State.RUNNING);
   }
 
   @Override

Modified: incubator/hama/trunk/src/java/org/apache/hama/util/VersionInfo.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/util/VersionInfo.java?rev=1100148&r1=1100147&r2=1100148&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/util/VersionInfo.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/util/VersionInfo.java Fri May  6 09:25:44
2011
@@ -23,6 +23,6 @@ package org.apache.hama.util;
 public class VersionInfo {
 
   public static void main(String[] args) {
-    System.out.println("Apache Hama - 0.2");
+    System.out.println("Apache Hama - 0.3");
   }
 }

Modified: incubator/hama/trunk/src/test/org/apache/hama/HamaClusterTestCase.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/test/org/apache/hama/HamaClusterTestCase.java?rev=1100148&r1=1100147&r2=1100148&view=diff
==============================================================================
--- incubator/hama/trunk/src/test/org/apache/hama/HamaClusterTestCase.java (original)
+++ incubator/hama/trunk/src/test/org/apache/hama/HamaClusterTestCase.java Fri May  6 09:25:44
2011
@@ -31,6 +31,7 @@ public abstract class HamaClusterTestCas
   protected MiniBSPCluster bspCluster;
   protected MiniZooKeeperCluster zooKeeperCluster;
   protected boolean startDfs;
+  protected int numOfGroom = 2;
 
   /** default constructor */
   public HamaClusterTestCase() {
@@ -53,7 +54,7 @@ public abstract class HamaClusterTestCas
     this.zooKeeperCluster = new MiniZooKeeperCluster();
     int clientPort = this.zooKeeperCluster.startup(testDir);
     conf.set("hama.zookeeper.property.clientPort", Integer.toString(clientPort));
-    bspCluster = new MiniBSPCluster(this.conf, 2); 
+    bspCluster = new MiniBSPCluster(this.conf, numOfGroom); 
     bspCluster.startBSPCluster();
   }
 

Modified: incubator/hama/trunk/src/test/org/apache/hama/bsp/TestBSPMasterGroomServer.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/test/org/apache/hama/bsp/TestBSPMasterGroomServer.java?rev=1100148&r1=1100147&r2=1100148&view=diff
==============================================================================
--- incubator/hama/trunk/src/test/org/apache/hama/bsp/TestBSPMasterGroomServer.java (original)
+++ incubator/hama/trunk/src/test/org/apache/hama/bsp/TestBSPMasterGroomServer.java Fri May
 6 09:25:44 2011
@@ -57,6 +57,7 @@ public class TestBSPMasterGroomServer ex
     // Set the task size as a number of GroomServer
     BSPJobClient jobClient = new BSPJobClient(configuration);
     ClusterStatus cluster = jobClient.getClusterStatus(false);
+    assertEquals(this.numOfGroom, cluster.getMaxTasks());
     bsp.setNumBspTask(cluster.getGroomServers());
     FileSystem fileSys = FileSystem.get(conf);
 



Mime
View raw message