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 and Description |
---|
PersistentWindowingTopology() |
Modifier and Type | Method and Description |
---|---|
static void |
main(String[] args)
Create and deploy the topology.
|
Copyright © 2020 The Apache Software Foundation. All rights reserved.