public class

CustomRebalancerContext

extends PartitionedRebalancerContext
java.lang.Object
   ↳ org.apache.helix.controller.rebalancer.context.BasicRebalancerContext
     ↳ org.apache.helix.controller.rebalancer.context.PartitionedRebalancerContext
       ↳ org.apache.helix.controller.rebalancer.context.CustomRebalancerContext

Class Overview

RebalancerContext for a resource that should be rebalanced in CUSTOMIZED mode. By default, it corresponds to CustomRebalancer

Summary

Nested Classes
class CustomRebalancerContext.Builder Build a CustomRebalancerContext. 
Public Constructors
CustomRebalancerContext()
Instantiate a CustomRebalancerContext
Public Methods
void generateDefaultConfiguration(StateModelDefinition stateModelDef, Set<ParticipantId> participantSet)
Generate preference maps based on a default cluster setup
Map<ParticipantIdState> getPreferenceMap(PartitionId partitionId)
Get the preference map of a partition
Map<PartitionIdMap<ParticipantIdState>> getPreferenceMaps()
Get the preference maps of the partitions and replicas of the resource
void setPreferenceMaps(Map<PartitionIdMap<ParticipantIdState>> preferenceMaps)
Set the preference maps of the partitions and replicas of the resource
[Expand]
Inherited Methods
From class org.apache.helix.controller.rebalancer.context.PartitionedRebalancerContext
From class org.apache.helix.controller.rebalancer.context.BasicRebalancerContext
From class java.lang.Object
From interface org.apache.helix.controller.rebalancer.context.RebalancerContext
From interface org.apache.helix.controller.rebalancer.context.ReplicatedRebalancerContext

Public Constructors

public CustomRebalancerContext ()

Instantiate a CustomRebalancerContext

Public Methods

public void generateDefaultConfiguration (StateModelDefinition stateModelDef, Set<ParticipantId> participantSet)

Generate preference maps based on a default cluster setup

Parameters
stateModelDef the state model definition to follow
participantSet the set of participant ids to configure for

public Map<ParticipantIdState> getPreferenceMap (PartitionId partitionId)

Get the preference map of a partition

Parameters
partitionId the partition to look up
Returns
  • map of participant to state

public Map<PartitionIdMap<ParticipantIdState>> getPreferenceMaps ()

Get the preference maps of the partitions and replicas of the resource

Returns
  • map of partition to participant and state

public void setPreferenceMaps (Map<PartitionIdMap<ParticipantIdState>> preferenceMaps)

Set the preference maps of the partitions and replicas of the resource

Parameters
preferenceMaps map of partition to participant and state