if (rebalancer != null && mappingCalculator != null) {
try {
HelixManager manager = event.getAttribute("helixmanager");
rebalancer.init(manager);
idealState =
rebalancer.computeNewIdealState(resourceName, idealState, currentStateOutput, cache);
// Use the internal MappingCalculator interface to compute the final assignment
// The next release will support rebalancers that compute the mapping from start to finish
ResourceAssignment partitionStateAssignment =
mappingCalculator.computeBestPossiblePartitionState(cache, idealState, resource,