public class DirectProvider extends AbstractTopologyProvider<DirectTopology> implements DirectSubmitter<Topology,Job>
DirectProvider
is a TopologyProvider
that
runs a submitted topology as a Job
in threads
in the current virtual machine.
A job (execution of a topology) continues to execute
while any of its elements have remaining work,
such as any of the topology's source streams are capable
of generating tuples.
"Endless" source streams never terminate - e.g., a stream
created by generate()
,
poll()
,
or events()
.
Hence a job with such sources runs until either it or some other
entity terminates it.
Constructor and Description |
---|
DirectProvider() |
Modifier and Type | Method and Description |
---|---|
ServiceContainer |
getServices()
Access to services.
|
DirectTopology |
newTopology(java.lang.String name)
Create a new topology with a given name.
|
java.util.concurrent.Future<Job> |
submit(Topology topology)
Submit an executable.
|
java.util.concurrent.Future<Job> |
submit(Topology topology,
com.google.gson.JsonObject config)
Submit an executable.
|
newTopology
public ServiceContainer getServices()
The returned services instance is shared across all jobs submitted to this provider.
getServices
in interface DirectSubmitter<Topology,Job>
public DirectTopology newTopology(java.lang.String name)
TopologyProvider
newTopology
in interface TopologyProvider
newTopology
in class AbstractTopologyProvider<DirectTopology>
name
- name for topologypublic java.util.concurrent.Future<Job> submit(Topology topology)
Submitter
submit(executable, new JsonObject())
.public java.util.concurrent.Future<Job> submit(Topology topology, com.google.gson.JsonObject config)
Submitter
submit
in interface Submitter<Topology,Job>
topology
- executable to submitconfig
- context information for the submissionCopyright © 2016 The Apache Software Foundation. All Rights Reserved - bbe71fa-20161201-1641