hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tjungb...@apache.org
Subject svn commit: r1374600 - /hama/trunk/graph/src/main/java/org/apache/hama/graph/GraphJobRunner.java
Date Sat, 18 Aug 2012 15:48:09 GMT
Author: tjungblut
Date: Sat Aug 18 15:48:08 2012
New Revision: 1374600

URL: http://svn.apache.org/viewvc?rev=1374600&view=rev
Log:
Merge to last working revision

Modified:
    hama/trunk/graph/src/main/java/org/apache/hama/graph/GraphJobRunner.java

Modified: hama/trunk/graph/src/main/java/org/apache/hama/graph/GraphJobRunner.java
URL: http://svn.apache.org/viewvc/hama/trunk/graph/src/main/java/org/apache/hama/graph/GraphJobRunner.java?rev=1374600&r1=1374599&r2=1374600&view=diff
==============================================================================
--- hama/trunk/graph/src/main/java/org/apache/hama/graph/GraphJobRunner.java (original)
+++ hama/trunk/graph/src/main/java/org/apache/hama/graph/GraphJobRunner.java Sat Aug 18 15:48:08
2012
@@ -397,16 +397,16 @@ public final class GraphJobRunner<V exte
     Vertex<V, E, M> vertex = newVertexInstance(vertexClass, conf);
     vertex.setPeer(peer);
     vertex.runner = this;
-
-    KeyValuePair<Writable, Writable> next = null;
-    int lines = 0;
-    while ((next = peer.readNext()) != null) {
+    while (true) {
+      KeyValuePair<Writable, Writable> next = peer.readNext();
+      if (next == null) {
+        break;
+      }
       boolean vertexFinished = reader.parseVertex(next.getKey(),
           next.getValue(), vertex);
       if (!vertexFinished) {
         continue;
       }
-
       if (vertex.getEdges() == null) {
         vertex.setEdges(new ArrayList<Edge<V, E>>(0));
       }
@@ -426,26 +426,12 @@ public final class GraphJobRunner<V exte
         }
         peer.send(peer.getPeerName(partition), new GraphJobMessage(vertex));
       } else {
-        // FIXME need to set destination names
         vertex.setup(conf);
         vertices.put(vertex.getVertexID(), vertex);
       }
       vertex = newVertexInstance(vertexClass, conf);
       vertex.setPeer(peer);
       vertex.runner = this;
-
-      lines++;
-      if ((lines % 100000) == 0) {
-        peer.sync();
-        GraphJobMessage msg = null;
-        while ((msg = peer.getCurrentMessage()) != null) {
-          Vertex<V, E, M> messagedVertex = (Vertex<V, E, M>) msg.getVertex();
-          messagedVertex.setPeer(peer);
-          messagedVertex.runner = this;
-          messagedVertex.setup(conf);
-          vertices.put(messagedVertex.getVertexID(), messagedVertex);
-        }
-      }
     }
 
     if (runtimePartitioning) {
@@ -460,8 +446,6 @@ public final class GraphJobRunner<V exte
       }
     }
 
-    LOG.info("Loading finished at " + peer.getSuperstepCount() + " steps.");
-
     /*
      * If the user want to repair the graph, it should traverse through that
      * local chunk of adjancency list and message the corresponding peer to



Mime
View raw message