flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From va...@apache.org
Subject [2/7] flink git commit: [FLINK-1522][gelly] Fixed faulty split into create/runVertexCentricIteration
Date Wed, 04 Mar 2015 20:33:04 GMT
[FLINK-1522][gelly] Fixed faulty split into create/runVertexCentricIteration

This closes #429


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

Branch: refs/heads/master
Commit: 8961bd19a82e44eb8655232f37a5baadb59a964b
Parents: f329e4e
Author: andralungu <lungu.andra@gmail.com>
Authored: Wed Mar 4 00:13:08 2015 +0100
Committer: Vasia Kalavri <vasia@apache.org>
Committed: Wed Mar 4 21:03:47 2015 +0100

----------------------------------------------------------------------
 flink-staging/flink-gelly/pom.xml               | 31 ++++++++++++++++++++
 .../library/SingleSourceShortestPaths.java      |  9 +++---
 2 files changed, 36 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/8961bd19/flink-staging/flink-gelly/pom.xml
----------------------------------------------------------------------
diff --git a/flink-staging/flink-gelly/pom.xml b/flink-staging/flink-gelly/pom.xml
index af1fcb4..8e00f98 100644
--- a/flink-staging/flink-gelly/pom.xml
+++ b/flink-staging/flink-gelly/pom.xml
@@ -52,4 +52,35 @@ under the License.
 			<scope>test</scope>
 		</dependency>
 	</dependencies>
+
+	<!-- See main pom.xml for explanation of profiles -->
+	<profiles>
+		<profile>
+			<id>hadoop-1</id>
+			<activation>
+				<property>
+					<!-- Please do not remove the 'hadoop1' comment. See ./tools/generate_specific_pom.sh
-->
+					<!--hadoop1--><name>hadoop.profile</name><value>1</value>
+				</property>
+			</activation>
+			<dependencies>
+				<!-- Add this here, for hadoop-2 we don't need it since we get guava transitively
-->
+				<dependency>
+					<groupId>com.google.guava</groupId>
+					<artifactId>guava</artifactId>
+					<version>${guava.version}</version>
+					<scope>provided</scope>
+				</dependency>
+			</dependencies>
+		</profile>
+		<profile>
+			<id>hadoop-2</id>
+			<activation>
+				<property>
+					<!-- Please do not remove the 'hadoop2' comment. See ./tools/generate_specific_pom.sh
-->
+					<!--hadoop2--><name>!hadoop.profile</name>
+				</property>
+			</activation>
+		</profile>
+	</profiles>
 </project>

http://git-wip-us.apache.org/repos/asf/flink/blob/8961bd19/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/library/SingleSourceShortestPaths.java
----------------------------------------------------------------------
diff --git a/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/library/SingleSourceShortestPaths.java
b/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/library/SingleSourceShortestPaths.java
index f069000..3e9a29d 100644
--- a/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/library/SingleSourceShortestPaths.java
+++ b/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/library/SingleSourceShortestPaths.java
@@ -45,11 +45,12 @@ public class SingleSourceShortestPaths<K extends Comparable<K>
& Serializable>
 	@Override
 	public Graph<K, Double, Double> run(Graph<K, Double, Double> input) {
 
-		VertexCentricIteration<K, Double, Double, Double> iteration = input.mapVertices(
-				new InitVerticesMapper<K>(srcVertexId)).createVertexCentricIteration(new VertexDistanceUpdater<K>(),
-				new MinDistanceMessenger<K>(), maxIterations);
+		Graph<K, Double, Double> mappedInput = input.mapVertices(new InitVerticesMapper<K>(srcVertexId));
 
-		return input.runVertexCentricIteration(iteration);
+		VertexCentricIteration<K, Double, Double, Double> iteration = mappedInput.createVertexCentricIteration(
+				new VertexDistanceUpdater<K>(), new MinDistanceMessenger<K>(), maxIterations);
+
+		return mappedInput.runVertexCentricIteration(iteration);
 	}
 
 	public static final class InitVerticesMapper<K extends Comparable<K> & Serializable>


Mime
View raw message