Github user manuzhang commented on a diff in the pull request:
https://github.com/apache/incubator-gearpump/pull/223#discussion_r139061668
--- Diff: core/src/main/scala/org/apache/gearpump/util/Graph.scala ---
@@ -243,13 +258,36 @@ class Graph[N, E](vertexList: List[N], edgeList:
List[(N, E, N)]) extends Serial
* The node returned by Iterator is stable sorted.
*/
def topologicalOrderIterator: Iterator[N] = {
- val newGraph = copy
- var output = List.empty[N]
+ tryTopologicalOrderIterator match {
+ case Success(intertor) => intertor
+ case Failure(_) => topologicalOrderWithCirclesIterator
--- End diff --
should we add a warning here ?
---