hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r1004879 - in /incubator/hama/trunk/src/java/org/apache/hama/bsp: BSP.java BSPMaster.java BSPPeer.java GroomServer.java
Date Wed, 06 Oct 2010 02:31:57 GMT
Author: edwardyoon
Date: Wed Oct  6 02:31:57 2010
New Revision: 1004879

URL: http://svn.apache.org/viewvc?rev=1004879&view=rev
Log:
NullPointerException in the process of invoking BSP class

Modified:
    incubator/hama/trunk/src/java/org/apache/hama/bsp/BSP.java
    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/GroomServer.java

Modified: incubator/hama/trunk/src/java/org/apache/hama/bsp/BSP.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/bsp/BSP.java?rev=1004879&r1=1004878&r2=1004879&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/bsp/BSP.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/bsp/BSP.java Wed Oct  6 02:31:57 2010
@@ -17,14 +17,10 @@
  */
 package org.apache.hama.bsp;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
 /**
  * This class provides an abstract implementation of the BSP interface
  */
 public abstract class BSP extends Thread implements BSPInterface {
-  private static final Log LOG = LogFactory.getLog(BSP.class);
   private BSPPeer bspPeer;
   
   /**
@@ -33,14 +29,10 @@ public abstract class BSP extends Thread
    * The run method performs the
    * {@link org.apache.hama.bsp.BSPInterface#bsp(BSPPeer)}
    */
-  public void run() {
-    try {
-      bsp(bspPeer);
-    } catch (Exception e) {
-      LOG.error(e);
-    }
+  public void runBSP() throws Exception {
+    bsp(bspPeer);
   }
-
+  
   public void setPeer(BSPPeer bspServer) {
     this.bspPeer = bspServer;
   }

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=1004879&r1=1004878&r2=1004879&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 Wed Oct  6 02:31:57 2010
@@ -413,7 +413,8 @@ public class BSPMaster implements JobSub
         if (report.getRunState() == TaskStatus.State.SUCCEEDED) {
           job.completedTask(tip, report);
         } else if (report.getRunState() == TaskStatus.State.FAILED) {
-          // Tell the job to fail the relevant task
+          // TODO Tell the job to fail the relevant task
+          
         } else {
           job.updateTaskStatus(tip, report);
         }

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=1004879&r1=1004878&r2=1004879&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 Wed Oct  6 02:31:57 2010
@@ -198,6 +198,7 @@ public class BSPPeer implements Watcher,
       synchronized (mutex) {
         List<String> list = zk.getChildren(bspRoot, true);
 
+        // TODO it must be same with the number of slave nodes, at this time. 
         if (list.size() < conf.getInt("bsp.peers.num", 0)) {
           mutex.wait();
         } else {

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=1004879&r1=1004878&r2=1004879&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 Wed Oct  6 02:31:57
2010
@@ -436,7 +436,12 @@ public class GroomServer implements Runn
         
         BSP bsp = (BSP) ReflectionUtils.newInstance(jobConf.getBspClass(), conf);
         bsp.setPeer(bspPeer);
-        bsp.start();
+        try {
+          bsp.runBSP();
+        } catch (Exception e) {
+          e.printStackTrace();
+          taskStatus.setRunState(TaskStatus.State.FAILED);
+        }
         
       } catch (IOException e) {
         // TODO Auto-generated catch block



Mime
View raw message