use of org.apache.flink.graph.asm.dataset.ChecksumHashCode.Checksum in project flink by apache.
the class ChecksumHashCode method getResult.
@Override
public Checksum getResult() {
Checksum checksum = vertexChecksum.getResult();
checksum.add(edgeChecksum.getResult());
return checksum;
}
use of org.apache.flink.graph.asm.dataset.ChecksumHashCode.Checksum in project flink by apache.
the class VertexInDegreeTest method testWithRMatGraph.
@Test
public void testWithRMatGraph() throws Exception {
DataSet<Vertex<LongValue, LongValue>> inDegree = directedRMatGraph.run(new VertexInDegree<LongValue, NullValue, NullValue>().setIncludeZeroDegreeVertices(true));
Checksum checksum = new ChecksumHashCode<Vertex<LongValue, LongValue>>().run(inDegree).execute();
assertEquals(902, checksum.getCount());
assertEquals(0x0000000000e1d885L, checksum.getChecksum());
}
use of org.apache.flink.graph.asm.dataset.ChecksumHashCode.Checksum in project flink by apache.
the class EdgeSourceDegreeTest method testWithRMatGraph.
@Test
public void testWithRMatGraph() throws Exception {
DataSet<Edge<LongValue, Tuple2<NullValue, LongValue>>> sourceDegreeOnSourceId = undirectedRMatGraph.run(new EdgeSourceDegree<LongValue, NullValue, NullValue>());
Checksum checksumOnSourceId = new ChecksumHashCode<Edge<LongValue, Tuple2<NullValue, LongValue>>>().run(sourceDegreeOnSourceId).execute();
assertEquals(20884, checksumOnSourceId.getCount());
assertEquals(0x000000019d8f0070L, checksumOnSourceId.getChecksum());
DataSet<Edge<LongValue, Tuple2<NullValue, LongValue>>> sourceDegreeOnTargetId = undirectedRMatGraph.run(new EdgeSourceDegree<LongValue, NullValue, NullValue>().setReduceOnTargetId(true));
Checksum checksumOnTargetId = new ChecksumHashCode<Edge<LongValue, Tuple2<NullValue, LongValue>>>().run(sourceDegreeOnTargetId).execute();
assertEquals(checksumOnTargetId, checksumOnTargetId);
}
use of org.apache.flink.graph.asm.dataset.ChecksumHashCode.Checksum in project flink by apache.
the class EdgeTargetDegreeTest method testWithRMatGraph.
@Test
public void testWithRMatGraph() throws Exception {
DataSet<Edge<LongValue, Tuple2<NullValue, LongValue>>> targetDegreeOnTargetId = undirectedRMatGraph.run(new EdgeSourceDegree<LongValue, NullValue, NullValue>());
Checksum checksumOnTargetId = new ChecksumHashCode<Edge<LongValue, Tuple2<NullValue, LongValue>>>().run(targetDegreeOnTargetId).execute();
assertEquals(20884, checksumOnTargetId.getCount());
assertEquals(0x000000019d8f0070L, checksumOnTargetId.getChecksum());
DataSet<Edge<LongValue, Tuple2<NullValue, LongValue>>> targetDegreeOnSourceId = undirectedRMatGraph.run(new EdgeTargetDegree<LongValue, NullValue, NullValue>().setReduceOnSourceId(true));
Checksum checksumOnSourceId = new ChecksumHashCode<Edge<LongValue, Tuple2<NullValue, LongValue>>>().run(targetDegreeOnSourceId).execute();
assertEquals(checksumOnTargetId, checksumOnSourceId);
}
use of org.apache.flink.graph.asm.dataset.ChecksumHashCode.Checksum in project flink by apache.
the class VertexDegreeTest method testWithRMatGraph.
@Test
public void testWithRMatGraph() throws Exception {
DataSet<Vertex<LongValue, LongValue>> degreeOnSourceId = undirectedRMatGraph.run(new VertexDegree<LongValue, NullValue, NullValue>());
Checksum checksumOnSourceId = new ChecksumHashCode<Vertex<LongValue, LongValue>>().run(degreeOnSourceId).execute();
assertEquals(902, checksumOnSourceId.getCount());
assertEquals(0x0000000000e1fb30L, checksumOnSourceId.getChecksum());
DataSet<Vertex<LongValue, LongValue>> degreeOnTargetId = undirectedRMatGraph.run(new VertexDegree<LongValue, NullValue, NullValue>().setReduceOnTargetId(true));
Checksum checksumOnTargetId = new ChecksumHashCode<Vertex<LongValue, LongValue>>().run(degreeOnTargetId).execute();
assertEquals(checksumOnSourceId, checksumOnTargetId);
}
Aggregations