Closed pedro-stanaka closed 3 months ago
I think the distributed engine should only use the whitelist of distributed optimizers; that way it can assume it only started with the "common" logical nodes.
Generally it looks good. I am wondering is there a usecase to change/remove the default optimizer applied in this case? Like the
DistributeAvgOptimizer
andDistributedExecutionOptimizer
But without DistributedExecutionOptimizer the engine doesnt distribute anymore
Maybe we should reserve this constructor as a prebaked engine where optimizers cannot be customized. In case we need more customizations, we can always use engine.New
and add wanted distributed optimizers. In practice I think we need
different engine.Opts
type for local and distributed engine to make sure options cannot be mixed.
I am going to close this one as per Filip's comment, the Distributed engine is merely an "alias" for the engine, so projects using this project as a library can defer to the New
constructor and pass the optimizers from the distributed engine.
As a follow up we might consider cleaning up the distributed engine constructor and struct since the field "endpoints" is unused right now. I will propose that in a follow up PR.
Summary
The distributed engine constructor overrides any logical optimizers passed to it, in this PR I am appending the optimizers to the existing ones in the options.