incubator-hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r992928 - in /incubator/hama/trunk/src: examples/org/apache/hama/examples/PiEstimator.java java/org/apache/hama/bsp/BSPMaster.java java/org/apache/hama/bsp/GroomServer.java
Date Mon, 06 Sep 2010 02:33:40 GMT
Author: edwardyoon
Date: Mon Sep  6 02:33:40 2010
New Revision: 992928

URL: http://svn.apache.org/viewvc?rev=992928&view=rev
Log:
Removing hard coded argument for heartbeat() method

Modified:
    incubator/hama/trunk/src/examples/org/apache/hama/examples/PiEstimator.java
    incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPMaster.java
    incubator/hama/trunk/src/java/org/apache/hama/bsp/GroomServer.java

Modified: incubator/hama/trunk/src/examples/org/apache/hama/examples/PiEstimator.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/examples/org/apache/hama/examples/PiEstimator.java?rev=992928&r1=992927&r2=992928&view=diff
==============================================================================
--- incubator/hama/trunk/src/examples/org/apache/hama/examples/PiEstimator.java (original)
+++ incubator/hama/trunk/src/examples/org/apache/hama/examples/PiEstimator.java Mon Sep  6
02:33:40 2010
@@ -91,15 +91,15 @@ public class PiEstimator {
     // BSP job configuration
     HamaConfiguration conf = new HamaConfiguration();
     // Execute locally
-    conf.set("bsp.master.address", "local");
-    //conf.set("bsp.master.address", "slave.udanax.org:40000");
+    //conf.set("bsp.master.address", "local");
+    conf.set("bsp.master.address", "slave.udanax.org:40000");
 
     BSPJob bsp = new BSPJob(conf, PiEstimator.class);
     // Set the job name
     bsp.setJobName("pi estimation example");
     bsp.setBspClass(MyEstimator.class);
 
-    bsp.setNumBspTask(1);
+    bsp.setNumBspTask(2);
     BSPJobClient.runJob(bsp);
   }
 }

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=992928&r1=992927&r2=992928&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 Mon Sep  6 02:33:40 2010
@@ -456,7 +456,6 @@ public class BSPMaster implements JobSub
       if (groomStatus == null) {
         LOG.warn("Unknown task tracker polling; ignoring: " + groomName);
       } else {
-        LOG.info(groomStatus);
         List<Task> tasks = taskScheduler.assignTasks(groomStatus);
         for (Task task : tasks) {
           if (tasks != null) {

Modified: incubator/hama/trunk/src/java/org/apache/hama/bsp/GroomServer.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/bsp/GroomServer.java?rev=992928&r1=992927&r2=992928&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/bsp/GroomServer.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/bsp/GroomServer.java Mon Sep  6 02:33:40
2010
@@ -289,7 +289,7 @@ public class GroomServer implements Runn
 
     // TODO - Later, acceptNewTask is to be set by the status of groom server.
     HeartbeatResponse heartbeatResponse = jobClient.heartbeat(status,
-        justStarted, justInited, true, heartbeatResponseId);
+        justStarted, justInited, acceptNewTasks, heartbeatResponseId);
     return heartbeatResponse;
   }
 
@@ -307,7 +307,6 @@ public class GroomServer implements Runn
       initialize();
       startCleanupThreads();
       boolean denied = false;
-      LOG.info("Why? " + running + ", " + shuttingDown + ", " + denied);
       while (running && !shuttingDown && !denied) {
 
         boolean staleState = false;
@@ -464,16 +463,27 @@ public class GroomServer implements Runn
   }
 
   public void launchTask() {
-    // TODO: task localizing and execute them.
+    // until job is completed, don't accept new task
+    acceptNewTasks = false;
 
+    // TODO: check the job file and task localizing and execute them.
+    LOG.info("Launch a task");
+    
+    LOG.info("JobFile: " + task.getJobFile());
+    LOG.info("Job Partition: " + task.getPartition());
+    
     /*
-     * try { jobConf.addResource(new Path(task.getJobFile().replace("file:",
-     * ""))); LOG.info("Job File>>>>> " + task.getJobFile().replace("file:",
-     * "")); BSP bsp = (BSP)
-     * ReflectionUtils.newInstance(jobConf.getClass("bsp.work.class",
-     * BSP.class), conf); bsp.setPeer(bspPeer); bsp.start(); } catch (Exception
-     * e) { System.exit(-1); }
-     */
+    try {
+      BSPJob jobConf = new BSPJob();
+      jobConf.addResource(new Path(task.getJobFile().replace("file:", "")));
+      LOG.info("Job File>>>>> " + task.getJobFile().replace("file:", ""));
+      BSP bsp = (BSP) ReflectionUtils.newInstance(jobConf.getClass("bsp.work.class", BSP.class),
conf);
+      bsp.setPeer(bspPeer);
+      bsp.start();
+    } catch (Exception e) {
+      System.exit(-1);
+    }
+    */
   }
 
   public String getServerName() {



Mime
View raw message