incubator-giraph-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ach...@apache.org
Subject svn commit: r1220883 - in /incubator/giraph/trunk: ./ src/main/java/org/apache/giraph/bsp/ src/main/java/org/apache/giraph/comm/ src/main/java/org/apache/giraph/graph/
Date Mon, 19 Dec 2011 18:35:11 GMT
Author: aching
Date: Mon Dec 19 18:35:10 2011
New Revision: 1220883

URL: http://svn.apache.org/viewvc?rev=1220883&view=rev
Log:
GIRAPH-106: Change prepareSuperstep() to make setMessages(Iterable<M>
messages) package-private. (aching)


Modified:
    incubator/giraph/trunk/CHANGELOG
    incubator/giraph/trunk/src/main/java/org/apache/giraph/bsp/CentralizedServiceWorker.java
    incubator/giraph/trunk/src/main/java/org/apache/giraph/comm/BasicRPCCommunications.java
    incubator/giraph/trunk/src/main/java/org/apache/giraph/comm/CommunicationsInterface.java
    incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/BasicVertex.java
    incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/BasicVertexResolver.java
    incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/BspServiceWorker.java
    incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/EdgeListVertex.java
    incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/LongDoubleFloatDoubleVertex.java
    incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/Vertex.java

Modified: incubator/giraph/trunk/CHANGELOG
URL: http://svn.apache.org/viewvc/incubator/giraph/trunk/CHANGELOG?rev=1220883&r1=1220882&r2=1220883&view=diff
==============================================================================
--- incubator/giraph/trunk/CHANGELOG (original)
+++ incubator/giraph/trunk/CHANGELOG Mon Dec 19 18:35:10 2011
@@ -2,6 +2,9 @@ Giraph Change Log
 
 Release 0.70.0 - unreleased
 
+  GIRAPH-106: Change prepareSuperstep() to make
+  setMessages(Iterable<M> messages) package-private. (aching)
+ 
   GIRAPH-105: BspServiceMaster.checkWorkers() should return empty
   lists instead of null. (ssc via aching)
 

Modified: incubator/giraph/trunk/src/main/java/org/apache/giraph/bsp/CentralizedServiceWorker.java
URL: http://svn.apache.org/viewvc/incubator/giraph/trunk/src/main/java/org/apache/giraph/bsp/CentralizedServiceWorker.java?rev=1220883&r1=1220882&r2=1220883&view=diff
==============================================================================
--- incubator/giraph/trunk/src/main/java/org/apache/giraph/bsp/CentralizedServiceWorker.java
(original)
+++ incubator/giraph/trunk/src/main/java/org/apache/giraph/bsp/CentralizedServiceWorker.java
Mon Dec 19 18:35:10 2011
@@ -147,6 +147,16 @@ public interface CentralizedServiceWorke
         Collection<? extends PartitionOwner> masterSetPartitionOwners);
 
     /**
+     * Assign messages to a vertex (bypasses package-private access to
+     * setMessages() for internal classes).
+     *
+     * @param vertex Vertex (owned by worker)
+     * @param messageIterator Messages to assign to the vertex
+     */
+    void assignMessagesToVertex(BasicVertex<I, V, E, M> vertex,
+                                Iterable<M> messageIterator);
+
+    /**
      * Get the GraphMapper that this service is using.  Vertices need to know
      * this.
      *

Modified: incubator/giraph/trunk/src/main/java/org/apache/giraph/comm/BasicRPCCommunications.java
URL: http://svn.apache.org/viewvc/incubator/giraph/trunk/src/main/java/org/apache/giraph/comm/BasicRPCCommunications.java?rev=1220883&r1=1220882&r2=1220883&view=diff
==============================================================================
--- incubator/giraph/trunk/src/main/java/org/apache/giraph/comm/BasicRPCCommunications.java
(original)
+++ incubator/giraph/trunk/src/main/java/org/apache/giraph/comm/BasicRPCCommunications.java
Mon Dec 19 18:35:10 2011
@@ -1014,7 +1014,7 @@ end[HADOOP_FACEBOOK]*/
                                          "in inMessages");
                             }
                         }
-                        vertex.setMessages(msgList);
+                        service.assignMessagesToVertex(vertex, msgList);
                         msgList.clear();
                         if (inMessages.remove(vertex.getVertexId()) == null) {
                             throw new IllegalStateException(

Modified: incubator/giraph/trunk/src/main/java/org/apache/giraph/comm/CommunicationsInterface.java
URL: http://svn.apache.org/viewvc/incubator/giraph/trunk/src/main/java/org/apache/giraph/comm/CommunicationsInterface.java?rev=1220883&r1=1220882&r2=1220883&view=diff
==============================================================================
--- incubator/giraph/trunk/src/main/java/org/apache/giraph/comm/CommunicationsInterface.java
(original)
+++ incubator/giraph/trunk/src/main/java/org/apache/giraph/comm/CommunicationsInterface.java
Mon Dec 19 18:35:10 2011
@@ -34,11 +34,9 @@ import org.apache.hadoop.ipc.VersionedPr
 /**
  * Basic interface for communication between workers.
  *
- *
  * @param <I extends Writable> vertex id
  * @param <M extends Writable> message data
- *
- **/
+ */
 @SuppressWarnings("rawtypes")
 /*if_not[HADOOP]
  else[HADOOP]*/

Modified: incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/BasicVertex.java
URL: http://svn.apache.org/viewvc/incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/BasicVertex.java?rev=1220883&r1=1220882&r2=1220883&view=diff
==============================================================================
--- incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/BasicVertex.java (original)
+++ incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/BasicVertex.java Mon Dec
19 18:35:10 2011
@@ -186,16 +186,16 @@ public abstract class BasicVertex<I exte
       */
     public abstract Iterable<M> getMessages();
 
-     /**
-      * Set the messages this vertex should process in the current superstep
-      *
-      * @param messages the messages sent to this vertex in the previous superstep
-      */
-    public abstract void setMessages(Iterable<M> messages);
+    /**
+     * Set the messages this vertex should process in the current superstep
+     *
+     * @param messages the messages sent to this vertex in the previous superstep
+     */
+    abstract void setMessages(Iterable<M> messages);
 
     /**
-      * Release unnecessary resources (will be called after vertex chose to halt)
-      */
+     * Release unnecessary resources (will be called after vertex chose to halt)
+     */
     abstract void releaseResources();
 
     /**

Modified: incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/BasicVertexResolver.java
URL: http://svn.apache.org/viewvc/incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/BasicVertexResolver.java?rev=1220883&r1=1220882&r2=1220883&view=diff
==============================================================================
--- incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/BasicVertexResolver.java
(original)
+++ incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/BasicVertexResolver.java
Mon Dec 19 18:35:10 2011
@@ -21,8 +21,6 @@ package org.apache.giraph.graph;
 import org.apache.hadoop.io.Writable;
 import org.apache.hadoop.io.WritableComparable;
 
-import java.util.List;
-
 /**
  * Handles all the situations that can arise upon creation/removal of
  * vertices and edges.

Modified: incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/BspServiceWorker.java
URL: http://svn.apache.org/viewvc/incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/BspServiceWorker.java?rev=1220883&r1=1220882&r2=1220883&view=diff
==============================================================================
--- incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/BspServiceWorker.java (original)
+++ incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/BspServiceWorker.java Mon
Dec 19 18:35:10 2011
@@ -500,6 +500,12 @@ public class BspServiceWorker<
     }
 
     @Override
+    public void assignMessagesToVertex(BasicVertex<I, V, E, M> vertex,
+            Iterable<M> messageIterator) {
+        vertex.setMessages(messageIterator);
+    }
+
+    @Override
     public void setup() {
         // Unless doing a restart, prepare for computation:
         // 1. Start superstep INPUT_SUPERSTEP (no computation)

Modified: incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/EdgeListVertex.java
URL: http://svn.apache.org/viewvc/incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/EdgeListVertex.java?rev=1220883&r1=1220882&r2=1220883&view=diff
==============================================================================
--- incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/EdgeListVertex.java (original)
+++ incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/EdgeListVertex.java Mon Dec
19 18:35:10 2011
@@ -106,7 +106,7 @@ public abstract class EdgeListVertex<I e
                 return false;
             }
             if (!ComparisonUtils.equal(getMessages(),
-                    ((EdgeListVertex) other).getMessages())) {
+                    otherVertex.getMessages())) {
                 return false;
             }
             return ComparisonUtils.equal(iterator(), otherVertex.iterator());
@@ -311,7 +311,7 @@ public abstract class EdgeListVertex<I e
     }
 
     @Override
-    public void setMessages(Iterable<M> messages) {
+    void setMessages(Iterable<M> messages) {
         msgList.clear();
         for (M message : messages) {
             msgList.add(message);

Modified: incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/LongDoubleFloatDoubleVertex.java
URL: http://svn.apache.org/viewvc/incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/LongDoubleFloatDoubleVertex.java?rev=1220883&r1=1220882&r2=1220883&view=diff
==============================================================================
--- incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/LongDoubleFloatDoubleVertex.java
(original)
+++ incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/LongDoubleFloatDoubleVertex.java
Mon Dec 19 18:35:10 2011
@@ -242,7 +242,7 @@ public abstract class LongDoubleFloatDou
     }
 
     @Override
-    public void setMessages(Iterable<DoubleWritable> messages) {
+    void setMessages(Iterable<DoubleWritable> messages) {
         messageList.clear();
         for (DoubleWritable message : messages) {
             messageList.add(message.get());

Modified: incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/Vertex.java
URL: http://svn.apache.org/viewvc/incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/Vertex.java?rev=1220883&r1=1220882&r2=1220883&view=diff
==============================================================================
--- incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/Vertex.java (original)
+++ incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/Vertex.java Mon Dec 19 18:35:10
2011
@@ -27,7 +27,6 @@ import org.apache.log4j.Logger;
 import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
-import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -243,7 +242,7 @@ public abstract class Vertex<I extends W
     }
 
     @Override
-    public void setMessages(Iterable<M> messages) {
+    void setMessages(Iterable<M> messages) {
         msgList.clear();
         for (M message : messages) {
             msgList.add(message);



Mime
View raw message