use of org.apache.flink.graph.asm.dataset.ChecksumHashCode.Checksum 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.Checksum 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.Checksum 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.Checksum 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());
}
use of org.apache.flink.graph.asm.dataset.ChecksumHashCode.Checksum in project flink by apache.
the class LocalClusteringCoefficientTest method testRMatGraph.
@Test
public void testRMatGraph() throws Exception {
DataSet<Result<LongValue>> cc = directedRMatGraph.run(new LocalClusteringCoefficient<LongValue, NullValue, NullValue>());
Checksum checksum = new org.apache.flink.graph.asm.dataset.ChecksumHashCode<Result<LongValue>>().run(cc).execute();
assertEquals(902, checksum.getCount());
assertEquals(0x000001bf83866775L, checksum.getChecksum());
}
Aggregations