View Source Skitter.BIS.KeyedState (Skitter v0.6.1)
Strategy for stateful operations that can partition their state by key.
This strategy can be used for stateful operations with a keyed state. It expects an operation to
provided a key
and a react
callback. When the operation receives data, the key
callback
will be called to determine the key of the incoming data, afterwards, the value will be sent to
a worker maintaining the state for key. This worker might live on another cluster node. Finally,
this worker will call the react
callback to update the state of the key.
operation-properties
Operation Properties
- in ports: A single in port is required.
- out ports: This strategy places no limitations on the out ports of the operation.
- callbacks:
key
(required): Called for each incoming data element. Can not access operation state.react
(required): Called for each incoming data element.init
(optional): Called to create an initial state for a key.conf
(optional): Called to create a configuration for the operation.