public class

CurrentStateBuilder

extends Object
java.lang.Object
   ↳ org.apache.helix.model.builder.CurrentStateBuilder

Class Overview

Assemble a CurrentState

Summary

Public Constructors
CurrentStateBuilder(ResourceId resourceId)
Build a current state for a given resource
Public Methods
CurrentStateBuilder addMapping(PartitionId partitionId, State state)
Add a single partition-state mapping for this instance and resource
CurrentStateBuilder addMappings(Map<PartitionIdState> mappings)
Add partition-state mappings for this instance and resource
CurrentState build()
Create a CurrentState
CurrentStateBuilder sessionId(SessionId sessionId)
Set the session id for this current state
CurrentStateBuilder stateModelDef(StateModelDefId stateModelDefId)
Set the state model for this current state
CurrentStateBuilder stateModelFactory(StateModelFactoryId stateModelFactoryId)
Set the name of the state model factory
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public CurrentStateBuilder (ResourceId resourceId)

Build a current state for a given resource

Parameters
resourceId resource identifier

Public Methods

public CurrentStateBuilder addMapping (PartitionId partitionId, State state)

Add a single partition-state mapping for this instance and resource

Parameters
partitionId the partition to map
state the replica state
Returns
  • CurrentStateBuilder

public CurrentStateBuilder addMappings (Map<PartitionIdState> mappings)

Add partition-state mappings for this instance and resource

Parameters
mappings map of partition to state
Returns
  • CurrentStateBuilder

public CurrentState build ()

Create a CurrentState

Returns
  • instantiated CurrentState

public CurrentStateBuilder sessionId (SessionId sessionId)

Set the session id for this current state

Parameters
sessionId session identifier
Returns
  • CurrentStateBuilder

public CurrentStateBuilder stateModelDef (StateModelDefId stateModelDefId)

Set the state model for this current state

Parameters
stateModelDefId state model definition identifier
Returns
  • CurrentStateBuilder

public CurrentStateBuilder stateModelFactory (StateModelFactoryId stateModelFactoryId)

Set the name of the state model factory

Returns
  • CurrentStateBuilder