public class JobEvents
extends java.lang.Object
A stream of job event tuples is
created by a listener which
subscribes to a JobRegistryService
.
Constructor and Description |
---|
JobEvents() |
Modifier and Type | Method and Description |
---|---|
static <T> TStream<T> |
source(Topology topology,
BiFunction<JobRegistryService.EventType,Job,T> wrapper)
Declares a stream populated by
JobRegistryService events. |
public static <T> TStream<T> source(Topology topology, BiFunction<JobRegistryService.EventType,Job,T> wrapper)
JobRegistryService
events.
The job registry is passed as a runtime service. At startup
JobRegistryService#addListener()
is called by the
runtime to subscribe an event listener. The listener invokes the given
wrapper
function to construct a tuple from a job event
and submits the tuple on the returned stream.
When the topology's execution is terminated,
JobRegistryServic#removeListener()
in invoked to unsubscribe
the tuple source from the job registry.
T
- Tuple typetopology
- the stream topologywrapper
- constructs a tuple from a job eventwrapper
.Topology.getRuntimeServiceSupplier()
,
JobRegistryService.addListener(BiConsumer)
,
JobRegistryService.removeListener(BiConsumer)
Copyright © 2016 The Apache Software Foundation. All Rights Reserved - bbe71fa-20161201-1641