January 2020
Intermediate to advanced
640 pages
16h 56m
English
Let's begin by examining the rather trivial StartJob method implementation for the master node:
func (n *MasterNode) StartJob(_ job.Details, execFactory bspgraph.ExecutorFactory) (*bspgraph.Executor, error) { if err := n.calculator.Graph().Reset(); err != nil { return nil, err } n.jobStartedAt = n.cfg.Clock.Now() n.calculator.SetExecutorFactory(execFactory) return n.calculator.Executor(), nil }
The StartJob method records the time when the job was started and performs the following three tasks: