hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tjungb...@apache.org
Subject svn commit: r1233591 - /incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/LocalBSPRunner.java
Date Thu, 19 Jan 2012 22:02:34 GMT
Author: tjungblut
Date: Thu Jan 19 22:02:33 2012
New Revision: 1233591

URL: http://svn.apache.org/viewvc?rev=1233591&view=rev
Log:
localrunner supersteps should be synchronized and working correctly now.

Modified:
    incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/LocalBSPRunner.java

Modified: incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/LocalBSPRunner.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/LocalBSPRunner.java?rev=1233591&r1=1233590&r2=1233591&view=diff
==============================================================================
--- incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/LocalBSPRunner.java (original)
+++ incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/LocalBSPRunner.java Thu Jan
19 22:02:33 2012
@@ -76,7 +76,7 @@ public class LocalBSPRunner implements J
   protected Configuration conf;
   protected FileSystem fs;
 
-  private static long superStepCount = 0L;
+  private static volatile long superStepCount = 0L;
   private static String[] peerNames;
 
   // this is used for not-input driven job
@@ -205,7 +205,7 @@ public class LocalBSPRunner implements J
   }
 
   // this class will spawn a new thread and executes the BSP
-  @SuppressWarnings( { "deprecation", "rawtypes" })
+  @SuppressWarnings({ "deprecation", "rawtypes" })
   static class BSPRunner implements Callable<BSP> {
 
     private Configuration conf;
@@ -225,8 +225,8 @@ public class LocalBSPRunner implements J
       conf.setInt(Constants.PEER_PORT, id);
       conf.set(Constants.PEER_HOST, "local");
 
-      bsp = (BSP) ReflectionUtils.newInstance(job.getConf().getClass(
-          "bsp.work.class", BSP.class), job.getConf());
+      bsp = (BSP) ReflectionUtils.newInstance(
+          job.getConf().getClass("bsp.work.class", BSP.class), job.getConf());
 
     }
 
@@ -393,8 +393,7 @@ public class LocalBSPRunner implements J
     }
 
     @Override
-    public void done(TaskAttemptID taskid)
-        throws IOException {
+    public void done(TaskAttemptID taskid) throws IOException {
 
     }
 
@@ -413,8 +412,6 @@ public class LocalBSPRunner implements J
     @Override
     public boolean statusUpdate(TaskAttemptID taskId, TaskStatus taskStatus)
         throws IOException, InterruptedException {
-      // does not need to be synchronized, because it is just an information.
-      superStepCount = taskStatus.getSuperstepCount();
       return true;
     }
 
@@ -461,6 +458,8 @@ public class LocalBSPRunner implements J
       } catch (Exception e) {
         throw new SyncException(e.toString());
       }
+      if (superstep > superStepCount)
+        superStepCount = superstep;
     }
 
     @Override



Mime
View raw message