January 2020
Intermediate to advanced
640 pages
16h 56m
English
The worker's StartJob implementation is slightly more complicated as we need to load the vertices and edges that correspond to the UUID range assigned to us by the master node. Fortunately, we have already written all of the required bits of code in Chapter 11, Splitting Monoliths into Microservices, so we can just go ahead and invoke the loading functions with the appropriate arguments:
func (n *WorkerNode) StartJob(jobDetails job.Details, execFactory bspgraph.ExecutorFactory) (*bspgraph.Executor, error) { n.jobStartedAt = time.Now() if err := n.calculator.Graph().Reset(); err != nil { return nil, err } else if err := n.loadLinks(jobDetails.PartitionFromID, jobDetails.PartitionToID, jobDetails.CreatedAt); err !=