use of org.apache.flink.graph.asm.dataset.ChecksumHashCode 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());
}
use of org.apache.flink.graph.asm.dataset.ChecksumHashCode in project flink by apache.
the class EdgeDegreePairTest method testWithRMatGraph.
@Test
public void testWithRMatGraph() throws Exception {
DataSet<Edge<LongValue, Tuple3<NullValue, LongValue, LongValue>>> degreePairOnSourceId = undirectedRMatGraph.run(new EdgeDegreePair<LongValue, NullValue, NullValue>());
Checksum checksumOnSourceId = new ChecksumHashCode<Edge<LongValue, Tuple3<NullValue, LongValue, LongValue>>>().run(degreePairOnSourceId).execute();
assertEquals(20884, checksumOnSourceId.getCount());
assertEquals(0x00000001e051efe4L, checksumOnSourceId.getChecksum());
DataSet<Edge<LongValue, Tuple3<NullValue, LongValue, LongValue>>> degreePairOnTargetId = undirectedRMatGraph.run(new EdgeDegreePair<LongValue, NullValue, NullValue>().setReduceOnTargetId(true));
Checksum checksumOnTargetId = new ChecksumHashCode<Edge<LongValue, Tuple3<NullValue, LongValue, LongValue>>>().run(degreePairOnTargetId).execute();
assertEquals(checksumOnSourceId, checksumOnTargetId);
}
use of org.apache.flink.graph.asm.dataset.ChecksumHashCode in project flink by apache.
the class LocalClusteringCoefficientTest method testRMatGraph.
@Test
public void testRMatGraph() throws Exception {
DataSet<Result<LongValue>> cc = undirectedRMatGraph.run(new LocalClusteringCoefficient<LongValue, NullValue, NullValue>());
Checksum checksum = new ChecksumHashCode<Result<LongValue>>().run(cc).execute();
assertEquals(902, checksum.getCount());
assertEquals(0x000001cab2d3677bL, checksum.getChecksum());
}
use of org.apache.flink.graph.asm.dataset.ChecksumHashCode in project flink by apache.
the class TriangleListingTest method testCompleteGraph.
@Test
public void testCompleteGraph() throws Exception {
long expectedDegree = completeGraphVertexCount - 1;
long expectedCount = completeGraphVertexCount * CombinatoricsUtils.binomialCoefficient((int) expectedDegree, 2) / 3;
DataSet<Result<LongValue>> tl = completeGraph.run(new TriangleListing<LongValue, NullValue, NullValue>());
Checksum checksum = new ChecksumHashCode<Result<LongValue>>().run(tl).execute();
assertEquals(expectedCount, checksum.getCount());
}
use of org.apache.flink.graph.asm.dataset.ChecksumHashCode in project flink by apache.
the class TriangleListingTest method testRMatGraph.
@Test
public void testRMatGraph() throws Exception {
DataSet<Result<LongValue>> tl = undirectedRMatGraph.run(new TriangleListing<LongValue, NullValue, NullValue>().setSortTriangleVertices(true));
Checksum checksum = new ChecksumHashCode<Result<LongValue>>().run(tl).execute();
assertEquals(75049, checksum.getCount());
assertEquals(0x00000001a5b500afL, checksum.getChecksum());
}
Aggregations