Skip to content

Commit

Permalink
[FLINK-1522][gelly] Fixed faulty split into create/runVertexCentricIt…
Browse files Browse the repository at this point in the history
…eration

This closes #429
  • Loading branch information
andralungu authored and vasia committed Mar 4, 2015
1 parent f329e4e commit 8961bd1
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 4 deletions.
31 changes: 31 additions & 0 deletions flink-staging/flink-gelly/pom.xml
Expand Up @@ -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>
Expand Up @@ -45,11 +45,12 @@ public SingleSourceShortestPaths(K srcVertexId, Integer maxIterations) {
@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>
Expand Down

0 comments on commit 8961bd1

Please sign in to comment.