public static class

ClusterConfig.Builder

extends Object
java.lang.Object
   ↳ org.apache.helix.api.config.ClusterConfig.Builder

Class Overview

Assembles a cluster configuration

Summary

Public Constructors
ClusterConfig.Builder(ClusterId id)
Initialize builder for a cluster
Public Methods
ClusterConfig.Builder addConstraint(ClusterConstraints constraint)
Add a constraint to the cluster
ClusterConfig.Builder addConstraint(ClusterConstraints.ConstraintType type, ConstraintId constraintId, ConstraintItem item)
Add a single constraint item
ClusterConfig.Builder addConstraints(Collection<ClusterConstraints> constraints)
Add multiple constraints to the cluster
ClusterConfig.Builder addParticipant(ParticipantConfig participant)
Add a participant to the cluster
ClusterConfig.Builder addParticipants(Collection<ParticipantConfig> participants)
Add multiple participants to the cluster
ClusterConfig.Builder addResource(ResourceConfig resource)
Add a resource to the cluster
ClusterConfig.Builder addResources(Collection<ResourceConfig> resources)
Add multiple resources to the cluster
ClusterConfig.Builder addStateModelDefinition(StateModelDefinition stateModelDef)
Add a state model definition to the cluster
ClusterConfig.Builder addStateModelDefinitions(Collection<StateModelDefinition> stateModelDefs)
Add multiple state model definitions
ClusterConfig.Builder addTransitionConstraint(Scope<?> scope, StateModelDefId stateModelDefId, Transition transition, int maxInFlightTransitions)
Add a constraint on the maximum number of in-flight transitions of a certain type
ClusterConfig.Builder autoJoin(boolean autoJoin)
Allow or disallow participants from automatically being able to join the cluster
ClusterConfig build()
Create the cluster configuration
ClusterConfig.Builder pausedStatus(boolean isPaused)
Set the paused status of the cluster
ClusterConfig.Builder userConfig(UserConfig userConfig)
Set the user configuration
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ClusterConfig.Builder (ClusterId id)

Initialize builder for a cluster

Parameters
id cluster id

Public Methods

public ClusterConfig.Builder addConstraint (ClusterConstraints constraint)

Add a constraint to the cluster

Parameters
constraint cluster constraint of a specific type
Returns
  • Builder

public ClusterConfig.Builder addConstraint (ClusterConstraints.ConstraintType type, ConstraintId constraintId, ConstraintItem item)

Add a single constraint item

Parameters
type type of the constraint
constraintId unique constraint identifier
item instantiated ConstraintItem
Returns
  • Builder

public ClusterConfig.Builder addConstraints (Collection<ClusterConstraints> constraints)

Add multiple constraints to the cluster

Parameters
constraints cluster constraints of multiple distinct types
Returns
  • Builder

public ClusterConfig.Builder addParticipant (ParticipantConfig participant)

Add a participant to the cluster

Parameters
participant participant configuration
Returns
  • Builder

public ClusterConfig.Builder addParticipants (Collection<ParticipantConfig> participants)

Add multiple participants to the cluster

Parameters
participants participant configurations
Returns
  • Builder

public ClusterConfig.Builder addResource (ResourceConfig resource)

Add a resource to the cluster

Parameters
resource resource configuration
Returns
  • Builder

public ClusterConfig.Builder addResources (Collection<ResourceConfig> resources)

Add multiple resources to the cluster

Parameters
resources resource configurations
Returns
  • Builder

public ClusterConfig.Builder addStateModelDefinition (StateModelDefinition stateModelDef)

Add a state model definition to the cluster

Parameters
stateModelDef state model definition of the cluster
Returns
  • Builder

public ClusterConfig.Builder addStateModelDefinitions (Collection<StateModelDefinition> stateModelDefs)

Add multiple state model definitions

Parameters
stateModelDefs collection of state model definitions for the cluster
Returns
  • Builder

public ClusterConfig.Builder addTransitionConstraint (Scope<?> scope, StateModelDefId stateModelDefId, Transition transition, int maxInFlightTransitions)

Add a constraint on the maximum number of in-flight transitions of a certain type

Parameters
scope scope of the constraint
stateModelDefId identifies the state model containing the transition
transition the transition to constrain
maxInFlightTransitions number of allowed in-flight transitions in the scope
Returns
  • Builder

public ClusterConfig.Builder autoJoin (boolean autoJoin)

Allow or disallow participants from automatically being able to join the cluster

Parameters
autoJoin true if allowed, false if disallowed
Returns
  • Builder

public ClusterConfig build ()

Create the cluster configuration

Returns
  • ClusterConfig

public ClusterConfig.Builder pausedStatus (boolean isPaused)

Set the paused status of the cluster

Parameters
isPaused true if paused, false otherwise
Returns
  • Builder

public ClusterConfig.Builder userConfig (UserConfig userConfig)

Set the user configuration

Parameters
userConfig user-specified properties
Returns
  • Builder