Search in sources :

Example 1 with Degrees

use of org.apache.flink.graph.asm.degree.annotate.directed.VertexDegrees.Degrees in project flink by apache.

the class EdgeDegreesPairTest method testWithRMatGraph.

@Test
public void testWithRMatGraph() throws Exception {
    DataSet<Edge<LongValue, Tuple3<NullValue, Degrees, Degrees>>> degreesPair = directedRMatGraph(10, 16).run(new EdgeDegreesPair<>());
    Checksum checksum = new ChecksumHashCode<Edge<LongValue, Tuple3<NullValue, Degrees, Degrees>>>().run(degreesPair).execute();
    assertEquals(12009, checksum.getCount());
    assertEquals(0x0000176fe94702a3L, checksum.getChecksum());
}
Also used : NullValue(org.apache.flink.types.NullValue) Degrees(org.apache.flink.graph.asm.degree.annotate.directed.VertexDegrees.Degrees) Checksum(org.apache.flink.graph.asm.dataset.ChecksumHashCode.Checksum) Tuple3(org.apache.flink.api.java.tuple.Tuple3) LongValue(org.apache.flink.types.LongValue) ChecksumHashCode(org.apache.flink.graph.asm.dataset.ChecksumHashCode) Edge(org.apache.flink.graph.Edge) Test(org.junit.Test)

Example 2 with Degrees

use of org.apache.flink.graph.asm.degree.annotate.directed.VertexDegrees.Degrees in project flink by apache.

the class EdgeTargetDegreesTest method testWithRMatGraph.

@Test
public void testWithRMatGraph() throws Exception {
    DataSet<Edge<LongValue, Tuple2<NullValue, Degrees>>> targetDegrees = directedRMatGraph(10, 16).run(new EdgeTargetDegrees<>());
    Checksum checksum = new ChecksumHashCode<Edge<LongValue, Tuple2<NullValue, Degrees>>>().run(targetDegrees).execute();
    assertEquals(12009, checksum.getCount());
    assertEquals(0x0000160af450cc81L, checksum.getChecksum());
}
Also used : NullValue(org.apache.flink.types.NullValue) Degrees(org.apache.flink.graph.asm.degree.annotate.directed.VertexDegrees.Degrees) Checksum(org.apache.flink.graph.asm.dataset.ChecksumHashCode.Checksum) Tuple2(org.apache.flink.api.java.tuple.Tuple2) LongValue(org.apache.flink.types.LongValue) ChecksumHashCode(org.apache.flink.graph.asm.dataset.ChecksumHashCode) Edge(org.apache.flink.graph.Edge) Test(org.junit.Test)

Example 3 with Degrees

use of org.apache.flink.graph.asm.degree.annotate.directed.VertexDegrees.Degrees in project flink by apache.

the class EdgeSourceDegreesTest method testWithRMatGraph.

@Test
public void testWithRMatGraph() throws Exception {
    DataSet<Edge<LongValue, Tuple2<NullValue, Degrees>>> sourceDegrees = directedRMatGraph(10, 16).run(new EdgeSourceDegrees<>());
    Checksum checksum = new ChecksumHashCode<Edge<LongValue, Tuple2<NullValue, Degrees>>>().run(sourceDegrees).execute();
    assertEquals(12009, checksum.getCount());
    assertEquals(0x0000162435fde1d9L, checksum.getChecksum());
}
Also used : NullValue(org.apache.flink.types.NullValue) Degrees(org.apache.flink.graph.asm.degree.annotate.directed.VertexDegrees.Degrees) Checksum(org.apache.flink.graph.asm.dataset.ChecksumHashCode.Checksum) Tuple2(org.apache.flink.api.java.tuple.Tuple2) LongValue(org.apache.flink.types.LongValue) ChecksumHashCode(org.apache.flink.graph.asm.dataset.ChecksumHashCode) Edge(org.apache.flink.graph.Edge) Test(org.junit.Test)

Example 4 with Degrees

use of org.apache.flink.graph.asm.degree.annotate.directed.VertexDegrees.Degrees in project flink by apache.

the class VertexDegreesTest method testWithRMatGraph.

@Test
public void testWithRMatGraph() throws Exception {
    DataSet<Vertex<LongValue, Degrees>> degrees = directedRMatGraph(10, 16).run(new VertexDegrees<>());
    Checksum checksum = new ChecksumHashCode<Vertex<LongValue, Degrees>>().run(degrees).execute();
    assertEquals(902, checksum.getCount());
    assertEquals(0x000001a3305dd86aL, checksum.getChecksum());
}
Also used : Vertex(org.apache.flink.graph.Vertex) Degrees(org.apache.flink.graph.asm.degree.annotate.directed.VertexDegrees.Degrees) Checksum(org.apache.flink.graph.asm.dataset.ChecksumHashCode.Checksum) LongValue(org.apache.flink.types.LongValue) ChecksumHashCode(org.apache.flink.graph.asm.dataset.ChecksumHashCode) Test(org.junit.Test)

Aggregations

ChecksumHashCode (org.apache.flink.graph.asm.dataset.ChecksumHashCode)4 Checksum (org.apache.flink.graph.asm.dataset.ChecksumHashCode.Checksum)4 Degrees (org.apache.flink.graph.asm.degree.annotate.directed.VertexDegrees.Degrees)4 LongValue (org.apache.flink.types.LongValue)4 Test (org.junit.Test)4 Edge (org.apache.flink.graph.Edge)3 NullValue (org.apache.flink.types.NullValue)3 Tuple2 (org.apache.flink.api.java.tuple.Tuple2)2 Tuple3 (org.apache.flink.api.java.tuple.Tuple3)1 Vertex (org.apache.flink.graph.Vertex)1