public class

FallbackRebalancer

extends Object
implements HelixRebalancer
java.lang.Object
   ↳ org.apache.helix.controller.rebalancer.FallbackRebalancer

Class Overview

This class is intented for use to wrap usages of Rebalancer. It is subject to removal once that class is removed.

Summary

Public Constructors
FallbackRebalancer()
Public Methods
ResourceAssignment computeResourceMapping(IdealState idealState, RebalancerConfig rebalancerConfig, ResourceAssignment prevAssignment, Cluster cluster, ResourceCurrentState currentState)
Given an ideal state for a resource and liveness of participants, compute a assignment of instances and states to each partition of a resource.
void init(HelixManager helixManager, ControllerContextProvider contextProvider)
Initialize the rebalancer with a HelixManager and ControllerContextProvider if necessary
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.apache.helix.controller.rebalancer.HelixRebalancer

Public Constructors

public FallbackRebalancer ()

Public Methods

public ResourceAssignment computeResourceMapping (IdealState idealState, RebalancerConfig rebalancerConfig, ResourceAssignment prevAssignment, Cluster cluster, ResourceCurrentState currentState)

Given an ideal state for a resource and liveness of participants, 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 and write the cluster data. This allows one to compute the ResourceAssignment according to app-specific requirements.

Say that you have:

 class MyRebalancerConfig implements RebalancerConfig
 
as your rebalancer config. To get a typed version, you can do the following:
 MyRebalancerConfig config = BasicRebalancerConfig.convert(rebalancerConfig,
     MyRebalancerConfig.class);
 

Parameters
idealState the ideal state that defines how a resource should be rebalanced
rebalancerConfig the properties of the resource for which a mapping will be computed
prevAssignment the previous ResourceAssignment of this cluster, or null if none
cluster complete snapshot of the cluster
currentState the current states of all partitions

public void init (HelixManager helixManager, ControllerContextProvider contextProvider)

Initialize the rebalancer with a HelixManager and ControllerContextProvider if necessary

Parameters
contextProvider An object that supports getting and setting context across pipeline runs