[ 
https://issues.apache.org/jira/browse/BEAM-4658?focusedWorklogId=127828&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-127828
 ]

ASF GitHub Bot logged work on BEAM-4658:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 26/Jul/18 16:15
            Start Date: 26/Jul/18 16:15
    Worklog Time Spent: 10m 
      Work Description: lukecwik commented on a change in pull request #6050: 
[BEAM-4658] Update pipeline representation in runner support libraries to 
handle timers.
URL: https://github.com/apache/beam/pull/6050#discussion_r205517383
 
 

 ##########
 File path: 
runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/graph/Networks.java
 ##########
 @@ -193,29 +201,55 @@ public final NodeT apply(NodeT input) {
         "Only networks without self loops are supported, given %s",
         network);
 
-    // Linked hashset will prevent duplicates from appearing and will maintain 
insertion order.
-    LinkedHashSet<NodeT> nodes = new LinkedHashSet<>(network.nodes().size());
-    Queue<NodeT> processingOrder = new ArrayDeque<>();
-    // Add all the roots
-    for (NodeT node : network.nodes()) {
-      if (network.inDegree(node) == 0) {
-        processingOrder.add(node);
-      }
-    }
+    // Uses the following algorithm:
 
 Review comment:
   Only nodes that are part of cycles are ever removed as part of the "delta" 
calculation.
   
   The algorithm:
   1) Removes all sinks from the graph (including newly created sinks once the 
graph is updated) until there are none.
   2) Removes all sources from the graph (including newly created sources once 
the graph is updated) until there are none.
   3) Remote a single back edge which highest delta. This may break a cycle. 
   
   Concretely, in your example, the algorithm would:
   * add Sink to the beginning of S2, removing it from the graph.
   * add B to the beginning of S2, removing it from the graph.
   * add A to the beginning of S2, removing it from the graph.
   * add Source1 or Source2 (ambiguous so lets say Source1) to the beginning of 
S2, removing it from the graph.
   * add Source2 to the beginning of S2, removing it from the graph.
   
   
   I expanded the comment within the code about the algorithm to clarify some 
parts of it.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 127828)
    Time Spent: 2h  (was: 1h 50m)

> Update pipeline representation in runner support libraries to handle timers
> ---------------------------------------------------------------------------
>
>                 Key: BEAM-4658
>                 URL: https://issues.apache.org/jira/browse/BEAM-4658
>             Project: Beam
>          Issue Type: Sub-task
>          Components: runner-core
>            Reporter: Luke Cwik
>            Assignee: Luke Cwik
>            Priority: Major
>          Time Spent: 2h
>  Remaining Estimate: 0h
>
> Expose relevant timer information on *ExecutableStage* to runners
> Update fusion logic to handle timers.
> Provide execution time interface to fire timers into *RemoteBundle*s and also 
> to receive new timers that are being set.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to