public interface

Rebalancer

org.apache.helix.controller.rebalancer.Rebalancer

Class Overview

Allows one to come up with custom implementation of a rebalancer.
This will be invoked on all changes that happen in the cluster.
Simply return the newIdealState for a resource in this method.

Deprecated. Use HelixRebalancer instead.

Summary

Public Methods
abstract IdealState computeResourceMapping(String resourceName, IdealState currentIdealState, CurrentStateOutput currentStateOutput, ClusterDataCache clusterData)
Given an ideal state for a resource and liveness of instances, compute a assignment of instances and states to each partition of a resource.
abstract void init(HelixManager manager)
Initialize the rebalancer with a HelixManager if necessary

Public Methods

public abstract IdealState computeResourceMapping (String resourceName, IdealState currentIdealState, CurrentStateOutput currentStateOutput, ClusterDataCache clusterData)

Given an ideal state for a resource and liveness of instances, compute a assignment of instances and states to each partition of a resource. This method provides all the relevant information needed to rebalance a resource. If you need additional information use manager.getAccessor to read the cluster data. This allows one to compute the newIdealState according to app specific requirements.

Parameters
resourceName the resource for which a mapping will be computed
currentIdealState the IdealState that corresponds to this resource
currentStateOutput the current states of all partitions
clusterData cache of the cluster state

public abstract void init (HelixManager manager)

Initialize the rebalancer with a HelixManager if necessary