public class

ClusterDataCache

extends Object
java.lang.Object
   ↳ org.apache.helix.controller.stages.ClusterDataCache

Class Overview

Reads the data from the cluster using data accessor. This output ClusterData which provides useful methods to search/lookup properties

Summary

Public Constructors
ClusterDataCache()
Public Methods
void cacheMessages(List<Message> messages)
ClusterConstraints getConstraint(ClusterConstraints.ConstraintType type)
Returns the ClusterConstraints for a given constraintType
Map<StringCurrentState> getCurrentState(String instanceName, String clientSessionId)
Provides the current state of the node for a given session id, the sessionid can be got from LiveInstance
Set<String> getDisabledInstancesForPartition(String partition)
Some partitions might be disabled on specific nodes.
IdealState getIdealState(String resourceName)
Provides the idealstate for a given resource
Map<StringMap<StringString>> getIdealStateRules()
Map<StringIdealState> getIdealStates()
Retrieves the idealstates for all resources
Map<StringInstanceConfig> getInstanceConfigMap()
Returns the instance config map
Map<StringLiveInstance> getLiveInstances()
Returns the LiveInstances for each of the instances that are curretnly up and running
Map<StringMessage> getMessages(String instanceName)
Provides a list of current outstanding transitions on a given instance.
int getReplicas(String resourceName)
Returns the number of replicas for a given resource.
StateModelDefinition getStateModelDef(String stateModelDefRef)
Provides the state model definition for a given state model
synchronized boolean refresh(HelixDataAccessor accessor)
This refreshes the cluster data by re-fetching the data from zookeeper in an efficient way
synchronized void requireFullRefresh()
Indicate that a full read should be done on the next refresh
synchronized void setIdealStates(List<IdealState> idealStates)
synchronized void setInstanceConfigs(List<InstanceConfig> instanceConfigs)
synchronized void setLiveInstances(List<LiveInstance> liveInstances)
String toString()
toString method to print the entire cluster state
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ClusterDataCache ()

Public Methods

public void cacheMessages (List<Message> messages)

public ClusterConstraints getConstraint (ClusterConstraints.ConstraintType type)

Returns the ClusterConstraints for a given constraintType

public Map<StringCurrentState> getCurrentState (String instanceName, String clientSessionId)

Provides the current state of the node for a given session id, the sessionid can be got from LiveInstance

public Set<String> getDisabledInstancesForPartition (String partition)

Some partitions might be disabled on specific nodes. This method allows one to fetch the set of nodes where a given partition is disabled

public IdealState getIdealState (String resourceName)

Provides the idealstate for a given resource

public Map<StringMap<StringString>> getIdealStateRules ()

public Map<StringIdealState> getIdealStates ()

Retrieves the idealstates for all resources

public Map<StringInstanceConfig> getInstanceConfigMap ()

Returns the instance config map

public Map<StringLiveInstance> getLiveInstances ()

Returns the LiveInstances for each of the instances that are curretnly up and running

public Map<StringMessage> getMessages (String instanceName)

Provides a list of current outstanding transitions on a given instance.

public int getReplicas (String resourceName)

Returns the number of replicas for a given resource.

public StateModelDefinition getStateModelDef (String stateModelDefRef)

Provides the state model definition for a given state model

public synchronized boolean refresh (HelixDataAccessor accessor)

This refreshes the cluster data by re-fetching the data from zookeeper in an efficient way

public synchronized void requireFullRefresh ()

Indicate that a full read should be done on the next refresh

public synchronized void setIdealStates (List<IdealState> idealStates)

public synchronized void setInstanceConfigs (List<InstanceConfig> instanceConfigs)

public synchronized void setLiveInstances (List<LiveInstance> liveInstances)

public String toString ()

toString method to print the entire cluster state