flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From u..@apache.org
Subject flink git commit: [FLINK-2113][gelly] removed env.execute() after print()
Date Fri, 29 May 2015 16:27:06 GMT
Repository: flink
Updated Branches:
  refs/heads/master 0930179f4 -> 7cb35ea91


[FLINK-2113][gelly] removed env.execute() after print()

This closes #749.


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

Branch: refs/heads/master
Commit: 7cb35ea918ea05639ed4b521910233aed7cd134f
Parents: 0930179
Author: andralungu <lungu.andra@gmail.com>
Authored: Fri May 29 17:41:51 2015 +0200
Committer: Ufuk Celebi <uce@apache.org>
Committed: Fri May 29 18:26:31 2015 +0200

----------------------------------------------------------------------
 .../org/apache/flink/graph/example/CommunityDetection.java   | 4 +++-
 .../org/apache/flink/graph/example/ConnectedComponents.java  | 5 ++++-
 .../apache/flink/graph/example/EuclideanGraphWeighing.java   | 4 +++-
 .../apache/flink/graph/example/GSAConnectedComponents.java   | 4 +++-
 .../java/org/apache/flink/graph/example/GSAPageRank.java     | 4 +++-
 .../flink/graph/example/GSASingleSourceShortestPaths.java    | 4 +++-
 .../java/org/apache/flink/graph/example/IncrementalSSSP.java | 8 ++++++--
 .../apache/flink/graph/example/JaccardSimilarityMeasure.java | 4 +++-
 .../org/apache/flink/graph/example/LabelPropagation.java     | 5 +++--
 .../java/org/apache/flink/graph/example/MusicProfiles.java   | 4 +++-
 .../main/java/org/apache/flink/graph/example/PageRank.java   | 4 +++-
 .../flink/graph/example/SingleSourceShortestPaths.java       | 4 +++-
 12 files changed, 40 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/7cb35ea9/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/CommunityDetection.java
----------------------------------------------------------------------
diff --git a/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/CommunityDetection.java
b/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/CommunityDetection.java
index 30005e7..e44e5bd 100644
--- a/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/CommunityDetection.java
+++ b/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/CommunityDetection.java
@@ -78,11 +78,13 @@ public class CommunityDetection implements ProgramDescription {
 		// emit result
 		if (fileOutput) {
 			communityVertices.writeAsCsv(outputPath, "\n", ",");
+
+			// since file sinks are lazy, we trigger the execution explicitly
+			env.execute("Executing Community Detection Example");
 		} else {
 			communityVertices.print();
 		}
 
-		env.execute("Executing Community Detection Example");
 	}
 
 	@Override

http://git-wip-us.apache.org/repos/asf/flink/blob/7cb35ea9/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/ConnectedComponents.java
----------------------------------------------------------------------
diff --git a/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/ConnectedComponents.java
b/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/ConnectedComponents.java
index b7c9045..3443a55 100644
--- a/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/ConnectedComponents.java
+++ b/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/ConnectedComponents.java
@@ -75,11 +75,14 @@ public class ConnectedComponents implements ProgramDescription {
 		// emit result
 		if (fileOutput) {
 			verticesWithMinIds.writeAsCsv(outputPath, "\n", ",");
+
+			// since file sinks are lazy, we trigger the execution explicitly
+			env.execute("Connected Components Example");
 		} else {
 			verticesWithMinIds.print();
 		}
 
-		env.execute("Connected Components Example");
+
 	}
 
 	@Override

http://git-wip-us.apache.org/repos/asf/flink/blob/7cb35ea9/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/EuclideanGraphWeighing.java
----------------------------------------------------------------------
diff --git a/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/EuclideanGraphWeighing.java
b/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/EuclideanGraphWeighing.java
index 565ef69..7e2c057 100644
--- a/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/EuclideanGraphWeighing.java
+++ b/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/EuclideanGraphWeighing.java
@@ -101,11 +101,13 @@ public class EuclideanGraphWeighing implements ProgramDescription {
 		// emit result
 		if (fileOutput) {
 			result.writeAsCsv(outputPath, "\n", ",");
+
+			// since file sinks are lazy, we trigger the execution explicitly
+			env.execute("Euclidean Graph Weighing Example");
 		} else {
 			result.print();
 		}
 
-		env.execute("Euclidean Graph Weighing Example");
 	}
 
 	@Override

http://git-wip-us.apache.org/repos/asf/flink/blob/7cb35ea9/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/GSAConnectedComponents.java
----------------------------------------------------------------------
diff --git a/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/GSAConnectedComponents.java
b/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/GSAConnectedComponents.java
index 30855e4..9b75c92 100755
--- a/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/GSAConnectedComponents.java
+++ b/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/GSAConnectedComponents.java
@@ -66,11 +66,13 @@ public class GSAConnectedComponents implements ProgramDescription {
 		// emit result
 		if (fileOutput) {
 			connectedComponents.writeAsCsv(outputPath, "\n", " ");
+
+			// since file sinks are lazy, we trigger the execution explicitly
+			env.execute("GSA Connected Components");
 		} else {
 			connectedComponents.print();
 		}
 
-		env.execute("GSA Connected Components");
 	}
 
 	@SuppressWarnings("serial")

http://git-wip-us.apache.org/repos/asf/flink/blob/7cb35ea9/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/GSAPageRank.java
----------------------------------------------------------------------
diff --git a/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/GSAPageRank.java
b/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/GSAPageRank.java
index b27a8fb..47f67b8 100644
--- a/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/GSAPageRank.java
+++ b/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/GSAPageRank.java
@@ -90,11 +90,13 @@ public class GSAPageRank implements ProgramDescription {
 		// emit result
 		if (fileOutput) {
 			pageRanks.writeAsCsv(outputPath, "\n", "\t");
+
+			// since file sinks are lazy, we trigger the execution explicitly
+			env.execute("GSA Page Ranks");
 		} else {
 			pageRanks.print();
 		}
 
-		env.execute("GSA Page Ranks");
 	}
 
 	// --------------------------------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/flink/blob/7cb35ea9/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/GSASingleSourceShortestPaths.java
----------------------------------------------------------------------
diff --git a/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/GSASingleSourceShortestPaths.java
b/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/GSASingleSourceShortestPaths.java
index bbc344f..b01aa23 100755
--- a/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/GSASingleSourceShortestPaths.java
+++ b/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/GSASingleSourceShortestPaths.java
@@ -64,11 +64,13 @@ public class GSASingleSourceShortestPaths implements ProgramDescription
{
 		// emit result
 		if(fileOutput) {
 			singleSourceShortestPaths.writeAsCsv(outputPath, "\n", " ");
+
+			// since file sinks are lazy, we trigger the execution explicitly
+			env.execute("GSA Single Source Shortest Paths");
 		} else {
 			singleSourceShortestPaths.print();
 		}
 
-		env.execute("GSA Single Source Shortest Paths");
 	}
 
 	@SuppressWarnings("serial")

http://git-wip-us.apache.org/repos/asf/flink/blob/7cb35ea9/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/IncrementalSSSP.java
----------------------------------------------------------------------
diff --git a/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/IncrementalSSSP.java
b/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/IncrementalSSSP.java
index 2bbc64b..8d94cbc 100644
--- a/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/IncrementalSSSP.java
+++ b/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/IncrementalSSSP.java
@@ -110,20 +110,24 @@ public class IncrementalSSSP implements ProgramDescription {
 			// Emit results
 			if(fileOutput) {
 				resultedVertices.writeAsCsv(outputPath, "\n", ",");
+
+				// since file sinks are lazy, we trigger the execution explicitly
+				env.execute("Incremental SSSP Example");
 			} else {
 				resultedVertices.print();
 			}
 
-			env.execute("Incremental SSSP Example");
 		} else {
 			// print the vertices
 			if(fileOutput) {
 				vertices.writeAsCsv(outputPath, "\n", ",");
+
+				// since file sinks are lazy, we trigger the execution explicitly
+				env.execute("Incremental SSSP Example");
 			} else {
 				vertices.print();
 			}
 
-			env.execute("Incremental SSSP Example");
 		}
 	}
 

http://git-wip-us.apache.org/repos/asf/flink/blob/7cb35ea9/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/JaccardSimilarityMeasure.java
----------------------------------------------------------------------
diff --git a/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/JaccardSimilarityMeasure.java
b/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/JaccardSimilarityMeasure.java
index dddaf41..ac06bda 100644
--- a/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/JaccardSimilarityMeasure.java
+++ b/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/JaccardSimilarityMeasure.java
@@ -89,11 +89,13 @@ public class JaccardSimilarityMeasure implements ProgramDescription {
 		// emit result
 		if (fileOutput) {
 			result.writeAsCsv(outputPath, "\n", ",");
+
+			// since file sinks are lazy, we trigger the execution explicitly
+			env.execute("Executing Jaccard Similarity Measure");
 		} else {
 			result.print();
 		}
 
-		env.execute("Executing Jaccard Similarity Measure");
 	}
 
 	@Override

http://git-wip-us.apache.org/repos/asf/flink/blob/7cb35ea9/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/LabelPropagation.java
----------------------------------------------------------------------
diff --git a/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/LabelPropagation.java
b/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/LabelPropagation.java
index 4012a4e..bee5af3 100644
--- a/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/LabelPropagation.java
+++ b/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/LabelPropagation.java
@@ -72,12 +72,13 @@ public class LabelPropagation implements ProgramDescription {
 		// Emit results
 		if(fileOutput) {
 			verticesWithCommunity.writeAsCsv(outputPath, "\n", ",");
+
+			// Execute the program
+			env.execute("Label Propagation Example");
 		} else {
 			verticesWithCommunity.print();
 		}
 
-		// Execute the program
-		env.execute("Label Propagation Example");
 	}
 
 	// *************************************************************************

http://git-wip-us.apache.org/repos/asf/flink/blob/7cb35ea9/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/MusicProfiles.java
----------------------------------------------------------------------
diff --git a/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/MusicProfiles.java
b/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/MusicProfiles.java
index dbf26e9..8244281 100644
--- a/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/MusicProfiles.java
+++ b/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/MusicProfiles.java
@@ -145,11 +145,13 @@ public class MusicProfiles implements ProgramDescription {
 
 		if (fileOutput) {
 			verticesWithCommunity.writeAsCsv(communitiesOutputPath, "\n", "\t");
+
+			// since file sinks are lazy, we trigger the execution explicitly
+			env.execute();
 		} else {
 			verticesWithCommunity.print();
 		}
 
-		env.execute();
 	}
 
 	public static final class ExtractMismatchSongIds implements MapFunction<String, Tuple1<String>>
{

http://git-wip-us.apache.org/repos/asf/flink/blob/7cb35ea9/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/PageRank.java
----------------------------------------------------------------------
diff --git a/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/PageRank.java
b/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/PageRank.java
index 68d59ad..e4ad13f 100644
--- a/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/PageRank.java
+++ b/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/PageRank.java
@@ -78,11 +78,13 @@ public class PageRank implements ProgramDescription {
 
 		if (fileOutput) {
 			pageRanks.writeAsCsv(outputPath, "\n", "\t");
+
+			// since file sinks are lazy, we trigger the execution explicitly
+			env.execute();
 		} else {
 			pageRanks.print();
 		}
 
-		env.execute();
 	}
 
 	@Override

http://git-wip-us.apache.org/repos/asf/flink/blob/7cb35ea9/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/SingleSourceShortestPaths.java
----------------------------------------------------------------------
diff --git a/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/SingleSourceShortestPaths.java
b/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/SingleSourceShortestPaths.java
index ae43e4c..9d7d2c2 100644
--- a/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/SingleSourceShortestPaths.java
+++ b/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/SingleSourceShortestPaths.java
@@ -68,11 +68,13 @@ public class SingleSourceShortestPaths implements ProgramDescription {
 		// emit result
 		if (fileOutput) {
 			singleSourceShortestPaths.writeAsCsv(outputPath, "\n", ",");
+
+			// since file sinks are lazy, we trigger the execution explicitly
+			env.execute("Single Source Shortest Paths Example");
 		} else {
 			singleSourceShortestPaths.print();
 		}
 
-		env.execute("Single Source Shortest Paths Example");
 	}
 
 	@Override


Mime
View raw message