Returns a source that will stream the
EventJournalCacheEventevents of a Hazelcast
ICache with the specified name. By
supplying a
predicate and
projection here instead of
in separate
map/filter transforms you allow the source to apply
these functions early, before generating any output, with the potential
of significantly reducing data traffic.
The source leverages data locality by making each of the underlying
processors fetch only those entries that are stored on the member where
it is running.
To use an
ICache as a streaming source, you must
EventJournalConfig for it. The journal has fixed capacity and
will drop events if it overflows.
The source saves the journal offsets to the snapshot. If the job
restarts, it starts emitting from the saved offsets with an exactly-once
guarantee (unless the journal has overflowed).
If you start a new job from an exported state, you can change the source
parameters as needed.
The default local parallelism for this processor is 2 (or 1 if just 1
CPU is available).
Predicate/projection class requirements
The classes implementing
predicateFn and
projectionFnneed to be available on the cluster's classpath or loaded using
Hazelcast User Code Deployment. It's not enough to add them to
the job classpath in
JobConfig. The same is true for the class
of the objects stored in the cache itself. If you cannot meet these
conditions, use
#cacheJournal(String,JournalInitialPosition)and add a subsequent
GeneralStage#map or
GeneralStage#filter stage.