Currently in each stage we iterate over each resource and compute the
idealstate, the calculation of one idealstate is independent of other
resource. Even though nothing is stopping a rebalancer for reasource A to
read the computed idealstate of another resource B its not implicit.
I think it will be a good idea to have concept of composite rebalancer.
For example the rebalancer interface that computes the idealstate looks
like this currently.
public ResourceAssignment computeResourceMapping(RebalancerConfig
rebalancerConfig,
ResourceAssignment prevAssignment, Cluster cluster,
ResourceCurrentState currentState);
we can add a compositerebalancer like
public Map<ResourceId,ResourceAssignment>
computeResourceMapping(RebalancerConfig rebalancerConfig,
Map<ResourceId,ResourceAssignment> prevAssignments, Cluster cluster,
Map<ResourceId,ResourceCurrentState> currentStateMap);
In the pipeline, if we see the rebalancer type is compositerebalancer then
we can invoke computeResourceMapping once for all resources that are
configured to use this specific rebalancer.
Thoughts?
Cheers,
Kishore G