Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FLINK-1201] [gelly] replaces tuples with vertex and edge classes
- Loading branch information
1 parent
071c468
commit b11f283
Showing
14 changed files
with
481 additions
and
319 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/EdgeToTuple3Map.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package flink.graphs; | ||
|
||
import java.io.Serializable; | ||
|
||
import org.apache.flink.api.common.functions.MapFunction; | ||
import org.apache.flink.api.java.tuple.Tuple3; | ||
|
||
public class EdgeToTuple3Map<K extends Comparable<K> & Serializable, | ||
EV extends Serializable> implements MapFunction<Edge<K, EV>, Tuple3<K, K, EV>> { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
public Tuple3<K, K, EV> map(Edge<K, EV> edge) { | ||
return new Tuple3<K, K, EV>(edge.f0, edge.f1, edge.f2); | ||
} | ||
|
||
} |
Oops, something went wrong.