public class

CurrentState

extends HelixProperty
java.lang.Object
   ↳ org.apache.helix.HelixProperty
     ↳ org.apache.helix.model.CurrentState

Class Overview

Current states of partitions in a resource for an instance.

Summary

Nested Classes
enum CurrentState.CurrentStateProperty Lookup keys for the current state  
[Expand]
Inherited Fields
From class org.apache.helix.HelixProperty
Public Constructors
CurrentState(String resourceName)
Instantiate a current state with a resource
CurrentState(ZNRecord record)
Instantiate a current state with a pre-populated ZNRecord
Public Methods
Map<StringString> getPartitionStateMap()
Get the partitions on this instance and the state that each partition is currently in.
String getResourceName()
Get the name of the resource
String getSessionId()
Get the session that this current state corresponds to
String getState(String partitionName)
Get the state of a partition on this instance
String getStateModelDefRef()
Get the state model that the resource follows
String getStateModelFactoryName()
Get the state model factory
boolean isValid()
Get property validity
void setSessionId(String sessionId)
Set the session that this current state corresponds to
void setState(String partitionName, String state)
Set the state that a partition is currently in on this instance
void setStateModelDefRef(String stateModelName)
Set the state model that the resource follows
void setStateModelFactoryName(String factoryName)
Set the state model factory
[Expand]
Inherited Methods
From class org.apache.helix.HelixProperty
From class java.lang.Object

Public Constructors

public CurrentState (String resourceName)

Instantiate a current state with a resource

Parameters
resourceName name identifying the resource

public CurrentState (ZNRecord record)

Instantiate a current state with a pre-populated ZNRecord

Parameters
record a ZNRecord corresponding to the current state

Public Methods

public Map<StringString> getPartitionStateMap ()

Get the partitions on this instance and the state that each partition is currently in.

Returns
  • (partition, state) pairs

public String getResourceName ()

Get the name of the resource

Returns
  • String resource identifier

public String getSessionId ()

Get the session that this current state corresponds to

Returns
  • String session identifier

public String getState (String partitionName)

Get the state of a partition on this instance

Parameters
partitionName the name of the partition
Returns
  • the state, or null if the partition is not present

public String getStateModelDefRef ()

Get the state model that the resource follows

Returns
  • an identifier of the state model

public String getStateModelFactoryName ()

Get the state model factory

Returns
  • a name that identifies the state model factory

public boolean isValid ()

Get property validity

Returns
  • true if valid, false if invalid

public void setSessionId (String sessionId)

Set the session that this current state corresponds to

Parameters
sessionId String session identifier

public void setState (String partitionName, String state)

Set the state that a partition is currently in on this instance

Parameters
partitionName the name of the partition
state the state of the partition

public void setStateModelDefRef (String stateModelName)

Set the state model that the resource follows

Parameters
stateModelName an identifier of the state model

public void setStateModelFactoryName (String factoryName)

Set the state model factory

Parameters
factoryName the name of the factory