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 and Description
    `StateFactory()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and 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 Detail

    - #### StateFactory

          public StateFactory()

  - ### Method Detail

    - #### 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

Copyright © 2021 The Apache Software Foundation. All rights reserved.