[ 
https://issues.apache.org/jira/browse/FLINK-2887?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14968828#comment-14968828
 ] 

ASF GitHub Bot commented on FLINK-2887:
---------------------------------------

Github user fhueske commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1281#discussion_r42725042
  
    --- Diff: 
flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/spargel/MessagingFunction.java
 ---
    @@ -129,24 +133,43 @@ public void postSuperstep() throws Exception {}
        }
     
        /**
    -    * Sends the given message to all vertices that are targets of an 
outgoing edge of the changed vertex.
    +    * Sends the given message to all vertices that are targets of an edge 
of the changed vertex.
         * This method is mutually exclusive to the method {@link #getEdges()} 
and may be called only once.
    +    * <p>
    +    * If the {@link EdgeDirection} is OUT (default), the message will be 
sent to out-neighbors.
    +    * If the {@link EdgeDirection} is IN, the message will be sent to 
in-neighbors.
    +    * If the {@link EdgeDirection} is ALL, the message will be sent to all 
neighbors.
         * 
         * @param m The message to send.
         */
        public void sendMessageToAllNeighbors(Message m) {
                if (edgesUsed) {
    -                   throw new IllegalStateException("Can use either 
'getEdges()' or 'sendMessageToAllTargets()' exactly once.");
    +                   throw new IllegalStateException("Can use either 
'getEdges()' or 'sendMessageToAllNeighbors()'"
    +                                   + "exactly once.");
                }
                
                edgesUsed = true;
    -           
                outValue.f1 = m;
                
                while (edges.hasNext()) {
                        Tuple next = (Tuple) edges.next();
    -                   K k = next.getField(1);
    -                   outValue.f0 = k;
    +
    +                   if (getDirection().equals(EdgeDirection.OUT)) {
    +                           outValue.f0 = next.getField(1);
    --- End diff --
    
    Is it intentional that this will send the message also to the vertex itself 
for each incoming edge?


> sendMessageToAllNeighbors ignores the EdgeDirection
> ---------------------------------------------------
>
>                 Key: FLINK-2887
>                 URL: https://issues.apache.org/jira/browse/FLINK-2887
>             Project: Flink
>          Issue Type: Bug
>          Components: Gelly
>    Affects Versions: 0.9.0, 0.10
>            Reporter: Vasia Kalavri
>            Assignee: Vasia Kalavri
>
> In vertex-centric iterations, while {{getEdges()}} correctly gathers all 
> edges when {{EdgeDirection}} is set to ALL, {{sendMessageToAllNeighbors}} 
> only sends messages to out-neighbors, no matter what edge direction has been 
> configured.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to