flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From va...@apache.org
Subject [2/2] flink git commit: [FLINK-3846] [gelly] Graph.removeEdges also removes duplicate edges
Date Sun, 01 May 2016 11:44:33 GMT
[FLINK-3846] [gelly] Graph.removeEdges also removes duplicate edges

All original edges are now emitted when no matching edge is found in the
edge removal set.

This closes #1948


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/204ccc5d
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/204ccc5d
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/204ccc5d

Branch: refs/heads/master
Commit: 204ccc5db606623673653034ff27bb09d05a1701
Parents: a5ad7d9
Author: Greg Hogan <code@greghogan.com>
Authored: Thu Apr 28 11:12:43 2016 -0400
Committer: vasia <vasia@apache.org>
Committed: Sun May 1 12:58:36 2016 +0200

----------------------------------------------------------------------
 .../src/main/java/org/apache/flink/graph/Graph.java       | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/204ccc5d/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java
----------------------------------------------------------------------
diff --git a/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java b/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java
index d46056a..12ac099 100755
--- a/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java
+++ b/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java
@@ -1459,14 +1459,8 @@ public class Graph<K, VV, EV> {
 		@Override
 		public void coGroup(Iterable<Edge<K, EV>> edge, Iterable<Edge<K, EV>>
edgeToBeRemoved,
 							Collector<Edge<K, EV>> out) throws Exception {
-
-			final Iterator<Edge<K, EV>> edgeIterator = edge.iterator();
-			final Iterator<Edge<K, EV>> edgeToBeRemovedIterator = edgeToBeRemoved.iterator();
-			Edge<K, EV> next;
-
-			if (edgeIterator.hasNext()) {
-				if (!edgeToBeRemovedIterator.hasNext()) {
-					next = edgeIterator.next();
+			if (!edgeToBeRemoved.iterator().hasNext()) {
+				for (Edge<K, EV> next : edge) {
 					out.collect(next);
 				}
 			}


Mime
View raw message