Book Image

Storm Blueprints: Patterns for Distributed Real-time Computation

Book Image

Storm Blueprints: Patterns for Distributed Real-time Computation

Overview of this book

Table of Contents (17 chapters)
Storm Blueprints: Patterns for Distributed Real-time Computation
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Implementing GraphState


The heart of the topology will be a Trident state implementation responsible for translating Trident tuples into graph structures and persisting them. Recall that a Trident state implementation consists of three components:

  • StateFactory: The StateFactory interface defines the method Trident uses to create the persistent State objects.

  • State: The Trident State interface defines the beginCommit() and commit() methods that are called before and after a Trident batch partition is written to the backing store. If the write succeeds (that is, all tuples are processed without error), Trident will call the commit() method.

  • StateUpdater: The StateUpdater interface defines the updateState() method that is called to update the state, given that there is a batch of tuples. Trident passes three arguments to this method: the State object to be updated, a list of TridentTuple objects that represents a batch partition, and a TridentCollector instance that can be used to optionally...