Package org.apache.storm.state
Interface State
- All Known Subinterfaces:
- KeyValueState<K,- V> 
- All Known Implementing Classes:
- InMemoryKeyValueState,- RedisKeyValueState
public interface State
The state of the component that is either managed by the framework (e.g in case of 
IStatefulBolt) or managed by the the
 individual components themselves.- 
Method SummaryModifier and TypeMethodDescriptionvoidcommit()Persist the current state.voidcommit(long txid) Commit a previously prepared transaction.voidprepareCommit(long txid) Invoked by the framework to prepare a transaction for commit.voidrollback()Rollback a prepared transaction to the previously committed state.
- 
Method Details- 
prepareCommitvoid prepareCommit(long txid) Invoked by the framework to prepare a transaction for commit. It should be possible to commit the prepared state later.The same txid can be prepared again, but the next txid cannot be prepared when previous one is not yet committed. - Parameters:
- txid- the transaction id
 
- 
commitvoid commit(long txid) Commit a previously prepared transaction. It should be possible to retrieve a committed state later.- Parameters:
- txid- the transaction id
 
- 
commitvoid commit()Persist the current state. This is used when the component manages the state.
- 
rollbackvoid rollback()Rollback a prepared transaction to the previously committed state.
 
-