Returns a source that will stream the
EventJournalCacheEventevents of the Hazelcast
ICache with the specified name from a
remote cluster. By supplying a
predicate and
projectionhere 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.
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. If you connect to another cluster, keep in mind
that the same offsets will be used. To avoid this, give different
Stage#setName to this source.
The default local parallelism for this processor is 1.
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
#remoteCacheJournal(String,ClientConfig,JournalInitialPosition)and add a subsequent
GeneralStage#map or
GeneralStage#filter stage.