org.apache.storm.starter

## Class StatefulTopology

- java.lang.Object
- - org.apache.storm.starter.StatefulTopology

-     public class StatefulTopology
      extends Object

  An example topology that demonstrates the use of `IStatefulBolt` to manage state. To run the example,

       $ storm jar examples/storm-starter/storm-starter-topologies-*.jar storm.starter.StatefulTopology statetopology

  The default state used is ‘InMemoryKeyValueState’ which does not persist the state across restarts. You could use ‘RedisKeyValueState’ to test state persistence by setting below property in conf/storm.yaml

       topology.state.provider: org.apache.storm.redis.state.RedisKeyValueStateProvider

  You should also start a local redis instance before running the ‘storm jar’ command. The default RedisKeyValueStateProvider parameters can be overridden in conf/storm.yaml, for e.g.

       topology.state.provider.config: ‘{“keyClass”:“…”, “valueClass”:“…”,  “keySerializerClass”:“…”, “valueSerializerClass”:“…”,  “jedisPoolConfig”:{“host”:“localhost”, “port”:6379,  “timeout”:2000, “database”:0, “password”:“xyz”}}’

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `StatefulTopology.PrinterBolt`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StatefulTopology()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `main(String[] args)`

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

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

- - ### Constructor Detail

    - #### StatefulTopology

          public StatefulTopology()

  - ### Method Detail

    - #### main

          public static void main(String[] args)
                           throws Exception

      Throws:
        `Exception`

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