incubator-hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r958454 - in /incubator/hama/trunk/src/java/org/apache/hama/bsp: BSPMaster.java BSPPeer.java LocalJobRunner.java
Date Mon, 28 Jun 2010 04:29:17 GMT
Author: edwardyoon
Date: Mon Jun 28 04:29:16 2010
New Revision: 958454

URL: http://svn.apache.org/viewvc?rev=958454&view=rev
Log:
I just committed trivial changes.

Modified:
    incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPMaster.java
    incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPPeer.java
    incubator/hama/trunk/src/java/org/apache/hama/bsp/LocalJobRunner.java

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=958454&r1=958453&r2=958454&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 Jun 28 04:29:16 2010
@@ -288,10 +288,7 @@ public class BSPMaster extends Thread im
 
     try {
       HamaConfiguration conf = new HamaConfiguration();
-      conf.set("bsp.master.port", "40000");
-      conf.set("bsp.groom.port", "40020");
-      conf.set("bsp.local.dir", conf.get("hadoop.tmp.dir") + "/bsp/local");
-      conf.set("bsp.system.dir", conf.get("hadoop.tmp.dir") + "/bsp/system");
+      conf.set("bsp.local.dir", conf.get("hama.tmp.dir") + "/bsp/local");
 
       BSPMaster master = BSPMaster.constructMaster(BSPMaster.class, conf);
       master.start();

Modified: incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPPeer.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPPeer.java?rev=958454&r1=958453&r2=958454&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPPeer.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/bsp/BSPPeer.java Mon Jun 28 04:29:16 2010
@@ -28,7 +28,6 @@ import java.util.concurrent.ConcurrentLi
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.conf.Configurable;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.ipc.RPC;
 import org.apache.hadoop.ipc.RPC.Server;

Modified: incubator/hama/trunk/src/java/org/apache/hama/bsp/LocalJobRunner.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/bsp/LocalJobRunner.java?rev=958454&r1=958453&r2=958454&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/bsp/LocalJobRunner.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/bsp/LocalJobRunner.java Mon Jun 28 04:29:16
2010
@@ -1,9 +1,8 @@
 package org.apache.hama.bsp;
 
 import java.io.IOException;
-import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.List;
+import java.util.Map;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -82,8 +81,8 @@ public class LocalJobRunner implements J
   @Override
   public boolean killTask(TaskAttemptID taskId, boolean shouldFail)
       throws IOException {
-    // TODO Auto-generated method stub
-    return false;
+    throw new UnsupportedOperationException("Killing tasks in "
+        + "LocalJobRunner is not supported");
   }
 
   @Override
@@ -117,8 +116,8 @@ public class LocalJobRunner implements J
     private Configuration conf;
     private int NUM_PEER;
     private BSPJob job;
-    private List<BSPRunner> list;
     private boolean threadDone = false;
+    private HashMap<String, BSPRunner> tasks = new HashMap<String, BSPRunner>();
 
     public Job(BSPJobID jobID, String jobFile, Configuration conf)
         throws IOException {
@@ -156,23 +155,24 @@ public class LocalJobRunner implements J
 
     public void run() {
       while (!threadDone) {
-        list = new ArrayList<BSPRunner>();
+        TaskID tID;
         for (int i = 0; i < NUM_PEER; i++) {
           this.conf.set(Constants.PEER_PORT, String.valueOf(30000 + i));
           BSPRunner runner = (BSPRunner) ReflectionUtils.newInstance(
               BSPRunner.class, this.conf);
-          list.add(runner);
+          tID = new TaskID(job.getJobID(), false, i);
+          tasks.put(tID.toString(), runner);
         }
 
-        for (int i = 0; i < NUM_PEER; i++) {
-          list.get(i).start();
+        for (Map.Entry<String, BSPRunner> e : tasks.entrySet()) {
+          e.getValue().start();
         }
 
-        for (int i = 0; i < NUM_PEER; i++) {
+        for (Map.Entry<String, BSPRunner> e : tasks.entrySet()) {
           try {
-            list.get(i).join();
-          } catch (InterruptedException e) {
-            e.printStackTrace();
+            e.getValue().join();
+          } catch (InterruptedException e1) {
+            e1.printStackTrace();
           }
         }
         done();



Mime
View raw message