Search in sources :

Example 31 with LongValue

use of org.apache.flink.types.LongValue 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.run(new EdgeDegreesPair<LongValue, NullValue, NullValue>());
    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 32 with LongValue

use of org.apache.flink.types.LongValue in project flink by apache.

the class EdgeSourceDegreesTest method testWithRMatGraph.

@Test
public void testWithRMatGraph() throws Exception {
    DataSet<Edge<LongValue, Tuple2<NullValue, Degrees>>> sourceDegrees = directedRMatGraph.run(new EdgeSourceDegrees<LongValue, NullValue, NullValue>());
    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 33 with LongValue

use of org.apache.flink.types.LongValue in project flink by apache.

the class EdgeTargetDegreesTest method testWithRMatGraph.

@Test
public void testWithRMatGraph() throws Exception {
    DataSet<Edge<LongValue, Tuple2<NullValue, Degrees>>> targetDegrees = directedRMatGraph.run(new EdgeTargetDegrees<LongValue, NullValue, NullValue>());
    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 34 with LongValue

use of org.apache.flink.types.LongValue in project flink by apache.

the class VertexDegreesTest method testWithRMatGraph.

@Test
public void testWithRMatGraph() throws Exception {
    DataSet<Vertex<LongValue, Degrees>> degrees = directedRMatGraph.run(new VertexDegrees<LongValue, NullValue, NullValue>());
    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) 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) LongValue(org.apache.flink.types.LongValue) ChecksumHashCode(org.apache.flink.graph.asm.dataset.ChecksumHashCode) Test(org.junit.Test)

Example 35 with LongValue

use of org.apache.flink.types.LongValue in project flink by apache.

the class VertexOutDegreeTest method testWithRMatGraph.

@Test
public void testWithRMatGraph() throws Exception {
    DataSet<Vertex<LongValue, LongValue>> outDegree = directedRMatGraph.run(new VertexOutDegree<LongValue, NullValue, NullValue>().setIncludeZeroDegreeVertices(true));
    Checksum checksum = new ChecksumHashCode<Vertex<LongValue, LongValue>>().run(outDegree).execute();
    assertEquals(902, checksum.getCount());
    assertEquals(0x0000000000e1d885L, checksum.getChecksum());
}
Also used : Vertex(org.apache.flink.graph.Vertex) 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

LongValue (org.apache.flink.types.LongValue)50 Test (org.junit.Test)33 NullValue (org.apache.flink.types.NullValue)23 Checksum (org.apache.flink.graph.asm.dataset.ChecksumHashCode.Checksum)17 ChecksumHashCode (org.apache.flink.graph.asm.dataset.ChecksumHashCode)15 Edge (org.apache.flink.graph.Edge)13 StringValue (org.apache.flink.types.StringValue)13 ExecutionEnvironment (org.apache.flink.api.java.ExecutionEnvironment)12 Vertex (org.apache.flink.graph.Vertex)11 IntValue (org.apache.flink.types.IntValue)9 Tuple2 (org.apache.flink.api.java.tuple.Tuple2)7 JDKRandomGeneratorFactory (org.apache.flink.graph.generator.random.JDKRandomGeneratorFactory)7 NumberFormat (java.text.NumberFormat)6 JobExecutionResult (org.apache.flink.api.common.JobExecutionResult)6 Tuple3 (org.apache.flink.api.java.tuple.Tuple3)6 ParameterTool (org.apache.flink.api.java.utils.ParameterTool)6 ProgramParametrizationException (org.apache.flink.client.program.ProgramParametrizationException)6 RMatGraph (org.apache.flink.graph.generator.RMatGraph)6 Graph (org.apache.flink.graph.Graph)5 GraphCsvReader (org.apache.flink.graph.GraphCsvReader)5