Apache Storm Component Guide
Also available as:
PDF
loading table of contents...

Implementing Custom Actions: IStateful Bolt Hooks

The IStateful bolt interface provides hook methods through which stateful bolts can implement custom actions. This feature is optional; stateful bolts are not expected to provide an implementation. The feature is provided so that other system-level components can be built on top of stateful abstractions; for example, to implement actions before the state of the stateful bolt is prepared, committed or rolled back.

/**
* This is a hook for the component to perform some actions just before the
* framework commits its state.
*/
void preCommit(long txid);

/**
* This is a hook for the component to perform some actions just before the
* framework prepares its state.
*/
void prePrepare(long txid);

/**
* This is a hook for the component to perform some actions just before the
* framework rolls back the prepared state.
*/
void preRollback();