public class

CurrentStateOutput

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

Class Overview

The current state includes both current state and pending messages For pending messages, we consider both toState and fromState Pending message prevents controller sending transitions that may potentially violate state constraints @see HELIX-541

Summary

Public Constructors
CurrentStateOutput()
Public Methods
int getBucketSize(String resource)
String getCurrentState(String resourceName, Partition partition, String instanceName)
given (resource, partition, instance), returns currentState
Map<StringString> getCurrentStateMap(String resourceName, Partition partition)
given (resource, partition), returns (instance->currentState) map
Set<Partition> getCurrentStateMappedPartitions(String resourceId)
Get the partitions mapped in the current state
String getInfo(String resourceName, Partition partition, String instanceName)
Map<StringMessage> getPendingMessageMap(String resourceName, Partition partition)
Given (resource, partition), returns (instance->pendingMessage) map
Message getPendingState(String resourceName, Partition partition, String instanceName)
given (resource, partition, instance), returns toState
Map<StringString> getPendingStateMap(String resourceName, Partition partition)
Given (resource, partition), returns (instance->toState) map
String getRequestedState(String resourceName, Partition partition, String instanceName)
String getResourceStateModelDef(String resourceName)
void setBucketSize(String resource, int bucketSize)
void setCurrentState(String resourceName, Partition partition, String instanceName, String state)
void setInfo(String resourceName, Partition partition, String instanceName, String state)
void setPendingState(String resourceName, Partition partition, String instanceName, Message message)
void setRequestedState(String resourceName, Partition partition, String instanceName, String state)
void setResourceStateModelDef(String resourceName, String stateModelDefName)
String toString()
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public CurrentStateOutput ()

Public Methods

public int getBucketSize (String resource)

public String getCurrentState (String resourceName, Partition partition, String instanceName)

given (resource, partition, instance), returns currentState

public Map<StringString> getCurrentStateMap (String resourceName, Partition partition)

given (resource, partition), returns (instance->currentState) map

public Set<Partition> getCurrentStateMappedPartitions (String resourceId)

Get the partitions mapped in the current state

Parameters
resourceId resource to look up
Returns
  • set of mapped partitions, or empty set if there are none

public String getInfo (String resourceName, Partition partition, String instanceName)

public Map<StringMessage> getPendingMessageMap (String resourceName, Partition partition)

Given (resource, partition), returns (instance->pendingMessage) map

Returns
  • pending messages map

public Message getPendingState (String resourceName, Partition partition, String instanceName)

given (resource, partition, instance), returns toState

Returns
  • pending message

public Map<StringString> getPendingStateMap (String resourceName, Partition partition)

Given (resource, partition), returns (instance->toState) map

Returns
  • pending target state map

public String getRequestedState (String resourceName, Partition partition, String instanceName)

public String getResourceStateModelDef (String resourceName)

public void setBucketSize (String resource, int bucketSize)

public void setCurrentState (String resourceName, Partition partition, String instanceName, String state)

public void setInfo (String resourceName, Partition partition, String instanceName, String state)

public void setPendingState (String resourceName, Partition partition, String instanceName, Message message)

public void setRequestedState (String resourceName, Partition partition, String instanceName, String state)

public void setResourceStateModelDef (String resourceName, String stateModelDefName)

public String toString ()