Class PersistentWindowingTopology

java.lang.Object
org.apache.storm.starter.PersistentWindowingTopology

public class PersistentWindowingTopology extends Object
An example that demonstrates the usage of IStatefulWindowedBolt with window persistence.

The framework automatically checkpoints the tuples in the window along with the bolt's state and restores the same during restarts.

This topology uses 'redis' for state persistence, so you should also start a redis instance before deploying. If you are running in local mode you can just start a redis server locally which will be used for storing the state. The default RedisKeyValueStateProvider parameters can be overridden by setting Config.TOPOLOGY_STATE_PROVIDER_CONFIG, for e.g.

 {
   "jedisPoolConfig": {
     "host": "redis-server-host",
     "port": 6379,
     "timeout": 2000,
     "database": 0,
     "password": "xyz"
   }
 }
 

  • Constructor Details

    • PersistentWindowingTopology

      public PersistentWindowingTopology()
  • Method Details

    • main

      public static void main(String[] args) throws Exception
      Create and deploy the topology.
      Parameters:
      args - args
      Throws:
      Exception - exception