January 2020
Intermediate to advanced
640 pages
16h 56m
English
A prerequisite for creating a new dbspgraph.Master instance or a dbspgraph.Worker instance is to provide a suitable, application-specific serializer for both aggregator values and any message that can potentially be exchanged between the graph nodes. For this particular application, graph vertices distribute their accumulated PageRank scores to their neighbors by exchanging IncomingScore messages:
type IncomingScoreMessage struct { Score float64 }
In addition, as you can see from the following snippet, which was taken from the PageRank calculator implementation, our serializer implementation also needs to be able to properly handle int and float64 used by the calculator's aggregator instances: ...