Package org.apache.storm.state

# Class StateFactory

java.lang.Object
org.apache.storm.state.StateFactory

public class StateFactory extends Object
A factory for creating `State` instances.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `StateFactory()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static State`
  `getState(String namespace, Map<String,Object> topoConf, TopologyContext context)`
  Returns a new state instance using the `Config.TOPOLOGY_STATE_PROVIDER` or a `InMemoryKeyValueState` if no provider is configured.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### StateFactory

    public StateFactory()

- ## Method Details

  - ### getState

    public static State getState(String namespace, Map<String,Object> topoConf, TopologyContext context)
    Returns a new state instance using the `Config.TOPOLOGY_STATE_PROVIDER` or a `InMemoryKeyValueState` if no provider is configured.
    Parameters:
      `namespace` - the state namespace
      `topoConf` - the storm conf
      `context` - the topology context
    Returns:
      the state instance