January 2020
Intermediate to advanced
640 pages
16h 56m
English
The code for generating an executor factory for the master is quite similar; to avoid repeating the same code blocks again, we will only list the implementations for each one of the individual callback wrappers, starting with preStepCallback:
func (f *masterExecutorFactory) preStepCallback(ctx context.Context, g *bspgraph.Graph) error { if _, err := f.barrier.WaitForWorkers(proto.Step_PRE); err != nil { return err } else if err := f.barrier.NotifyWorkers(&proto.Step{Type: proto.Step_PRE}); err != nil { return err } if f.origCallbacks.PreStep != nil { return f.origCallbacks.PreStep(ctx, g) } return nil}Compared to the worker-side implementation, the master behaves a bit differently. To begin with, the master ...