public abstract class

BasicRebalancerContext

extends Object
implements RebalancerContext
java.lang.Object
   ↳ org.apache.helix.controller.rebalancer.context.BasicRebalancerContext
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Abstract RebalancerContext that functions for generic subunits. Use a subclass that more concretely defines the subunits.

Summary

Nested Classes
class BasicRebalancerContext.AbstractBuilder<T extends AbstractBuilder<T>> Abstract builder for the base rebalancer context  
Public Constructors
BasicRebalancerContext()
Instantiate a basic rebalancer context
Public Methods
String getParticipantGroupTag()
Get the tag, if any, that participants must have in order to serve this resource
RebalancerRef getRebalancerRef()
Get a reference to the class used to rebalance this resource
ResourceId getResourceId()
Get the resource to rebalance
Class<? extends ContextSerializer> getSerializerClass()
Get the serializer.
StateModelDefId getStateModelDefId()
Get the state model definition that the resource follows
StateModelFactoryId getStateModelFactoryId()
Get the state model factory of this resource
Partition getSubUnit(PartitionId subUnitId)
Get a specific subunit
Set<? extends PartitionId> getSubUnitIdSet()
Get the subunits of the resource (e.g.
void setParticipantGroupTag(String participantGroupTag)
Set a tag that participants must have in order to serve this resource
void setRebalancerRef(RebalancerRef rebalancerRef)
Set the reference to the class used to rebalance this resource
void setResourceId(ResourceId resourceId)
Set the resource to rebalance
void setSerializerClass(Class<? extends ContextSerializer> serializer)
Set the class that can serialize this context
void setStateModelDefId(StateModelDefId stateModelDefId)
Set the state model definition that the resource follows
void setStateModelFactoryId(StateModelFactoryId stateModelFactoryId)
Set the state model factory that the resource uses
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.apache.helix.controller.rebalancer.context.RebalancerContext

Public Constructors

public BasicRebalancerContext ()

Instantiate a basic rebalancer context

Public Methods

public String getParticipantGroupTag ()

Get the tag, if any, that participants must have in order to serve this resource

Returns
  • participant group tag, or null

public RebalancerRef getRebalancerRef ()

Get a reference to the class used to rebalance this resource

Returns
  • RebalancerRef

public ResourceId getResourceId ()

Get the resource to rebalance

Returns
  • resource id

public Class<? extends ContextSerializer> getSerializerClass ()

Get the serializer. If none is provided, DefaultContextSerializer is used

Returns
  • ContextSerializer class object

public StateModelDefId getStateModelDefId ()

Get the state model definition that the resource follows

Returns
  • state model definition id

public StateModelFactoryId getStateModelFactoryId ()

Get the state model factory of this resource

Returns
  • state model factory id

public Partition getSubUnit (PartitionId subUnitId)

Get a specific subunit

Parameters
subUnitId the id of the subunit
Returns
  • SubUnit

public Set<? extends PartitionId> getSubUnitIdSet ()

Get the subunits of the resource (e.g. partitions)

Returns
  • set of subunit ids

public void setParticipantGroupTag (String participantGroupTag)

Set a tag that participants must have in order to serve this resource

Parameters
participantGroupTag string group tag

public void setRebalancerRef (RebalancerRef rebalancerRef)

Set the reference to the class used to rebalance this resource

Parameters
rebalancerRef RebalancerRef instance

public void setResourceId (ResourceId resourceId)

Set the resource to rebalance

Parameters
resourceId resource id

public void setSerializerClass (Class<? extends ContextSerializer> serializer)

Set the class that can serialize this context

Parameters
serializer serializer class that implements ContextSerializer

public void setStateModelDefId (StateModelDefId stateModelDefId)

Set the state model definition that the resource follows

Parameters
stateModelDefId state model definition id

public void setStateModelFactoryId (StateModelFactoryId stateModelFactoryId)

Set the state model factory that the resource uses

Parameters
stateModelFactoryId state model factory id