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
: TheStateFactory
interface defines the method Trident uses to create the persistentState
objects.State
: The TridentState
interface defines thebeginCommit()
andcommit()
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 thecommit()
method.StateUpdater
: TheStateUpdater
interface defines theupdateState()
method that is called to update the state, given that there is a batch of tuples. Trident passes three arguments to this method: theState
object to be updated, a list ofTridentTuple
objects that represents a batch partition, and aTridentCollector
instance that can be used to optionally...