Java Code Examples for org.apache.flink.graph.library.clustering.undirected.TriangleListing.Result#setVertexId1()
The following examples show how to use
org.apache.flink.graph.library.clustering.undirected.TriangleListing.Result#setVertexId1() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TriangleListing.java From Flink-CEPplus with Apache License 2.0 | 6 votes |
@Override public Result<T> map(Result<T> value) throws Exception { // by the triangle listing algorithm we know f1 < f2 if (value.getVertexId0().compareTo(value.getVertexId1()) > 0) { T tempVal = value.getVertexId0(); value.setVertexId0(value.getVertexId1()); if (tempVal.compareTo(value.getVertexId2()) <= 0) { value.setVertexId1(tempVal); } else { value.setVertexId1(value.getVertexId2()); value.setVertexId2(tempVal); } } return value; }
Example 2
Source File: TriangleListing.java From flink with Apache License 2.0 | 6 votes |
@Override public Result<T> map(Result<T> value) throws Exception { // by the triangle listing algorithm we know f1 < f2 if (value.getVertexId0().compareTo(value.getVertexId1()) > 0) { T tempVal = value.getVertexId0(); value.setVertexId0(value.getVertexId1()); if (tempVal.compareTo(value.getVertexId2()) <= 0) { value.setVertexId1(tempVal); } else { value.setVertexId1(value.getVertexId2()); value.setVertexId2(tempVal); } } return value; }
Example 3
Source File: TriangleListing.java From flink with Apache License 2.0 | 6 votes |
@Override public Result<T> map(Result<T> value) throws Exception { // by the triangle listing algorithm we know f1 < f2 if (value.getVertexId0().compareTo(value.getVertexId1()) > 0) { T tempVal = value.getVertexId0(); value.setVertexId0(value.getVertexId1()); if (tempVal.compareTo(value.getVertexId2()) <= 0) { value.setVertexId1(tempVal); } else { value.setVertexId1(value.getVertexId2()); value.setVertexId2(tempVal); } } return value; }
Example 4
Source File: TriangleListing.java From Flink-CEPplus with Apache License 2.0 | 4 votes |
@Override public void flatMap(Result<T> value, Collector<Result<T>> out) throws Exception { T tmp; // 0, 1, 2 out.collect(value); tmp = value.getVertexId0(); value.setVertexId0(value.getVertexId1()); value.setVertexId1(tmp); // 1, 0, 2 out.collect(value); tmp = value.getVertexId1(); value.setVertexId1(value.getVertexId2()); value.setVertexId2(tmp); // 1, 2, 0 out.collect(value); tmp = value.getVertexId0(); value.setVertexId0(value.getVertexId2()); value.setVertexId2(tmp); // 0, 2, 1 out.collect(value); tmp = value.getVertexId0(); value.setVertexId0(value.getVertexId1()); value.setVertexId1(tmp); // 2, 0, 1 out.collect(value); tmp = value.getVertexId1(); value.setVertexId1(value.getVertexId2()); value.setVertexId2(tmp); // 2, 1, 0 out.collect(value); }
Example 5
Source File: TriangleListing.java From flink with Apache License 2.0 | 4 votes |
@Override public void flatMap(Result<T> value, Collector<Result<T>> out) throws Exception { T tmp; // 0, 1, 2 out.collect(value); tmp = value.getVertexId0(); value.setVertexId0(value.getVertexId1()); value.setVertexId1(tmp); // 1, 0, 2 out.collect(value); tmp = value.getVertexId1(); value.setVertexId1(value.getVertexId2()); value.setVertexId2(tmp); // 1, 2, 0 out.collect(value); tmp = value.getVertexId0(); value.setVertexId0(value.getVertexId2()); value.setVertexId2(tmp); // 0, 2, 1 out.collect(value); tmp = value.getVertexId0(); value.setVertexId0(value.getVertexId1()); value.setVertexId1(tmp); // 2, 0, 1 out.collect(value); tmp = value.getVertexId1(); value.setVertexId1(value.getVertexId2()); value.setVertexId2(tmp); // 2, 1, 0 out.collect(value); }
Example 6
Source File: TriangleListing.java From flink with Apache License 2.0 | 4 votes |
@Override public void flatMap(Result<T> value, Collector<Result<T>> out) throws Exception { T tmp; // 0, 1, 2 out.collect(value); tmp = value.getVertexId0(); value.setVertexId0(value.getVertexId1()); value.setVertexId1(tmp); // 1, 0, 2 out.collect(value); tmp = value.getVertexId1(); value.setVertexId1(value.getVertexId2()); value.setVertexId2(tmp); // 1, 2, 0 out.collect(value); tmp = value.getVertexId0(); value.setVertexId0(value.getVertexId2()); value.setVertexId2(tmp); // 0, 2, 1 out.collect(value); tmp = value.getVertexId0(); value.setVertexId0(value.getVertexId1()); value.setVertexId1(tmp); // 2, 0, 1 out.collect(value); tmp = value.getVertexId1(); value.setVertexId1(value.getVertexId2()); value.setVertexId2(tmp); // 2, 1, 0 out.collect(value); }