public class Executable extends java.lang.Object implements RuntimeServices
Constructor and Description |
---|
Executable(java.lang.String name,
ServiceContainer containerServices)
Creates a new
Executable for the specified job. |
Executable(java.lang.String name,
ServiceContainer containerServices,
java.util.concurrent.ThreadFactory threads)
Creates a new
Executable for the specified topology name, which uses the
given thread factory to create new threads for oplet execution. |
Modifier and Type | Method and Description |
---|---|
<T extends Oplet<I,O>,I,O> |
addOpletInvocation(T oplet,
int inputs,
int outputs)
Creates a new
Invocation associated with the specified oplet. |
void |
close()
Shuts down the user scheduler and thread factory, close all
invocations, then shutdown the control scheduler.
|
Job |
createJob(Graph graph,
java.lang.String topologyName,
java.lang.String jobName) |
java.lang.Throwable |
getLastError() |
java.util.concurrent.ScheduledExecutorService |
getScheduler()
Returns the
ScheduledExecutorService used for running
executable graph elements. |
<T> T |
getService(java.lang.Class<T> serviceClass)
Acts as a service provider for executable elements in the graph, first
looking for a service specific to this job, and then one from the
container.
|
boolean |
hasActiveTasks()
Check whether there are user tasks still active.
|
void |
initialize()
Initializes the invocations.
|
void |
start()
Starts all the invocations.
|
public Executable(java.lang.String name, ServiceContainer containerServices)
Executable
for the specified job.name
- the name of the executablecontainerServices
- runtime services provided by the containerpublic Executable(java.lang.String name, ServiceContainer containerServices, java.util.concurrent.ThreadFactory threads)
Executable
for the specified topology name, which uses the
given thread factory to create new threads for oplet execution.name
- the name of the executablecontainerServices
- runtime services provided by the containerthreads
- thread factory for executing the opletspublic java.util.concurrent.ScheduledExecutorService getScheduler()
ScheduledExecutorService
used for running
executable graph elements.public <T> T getService(java.lang.Class<T> serviceClass)
getService
in interface RuntimeServices
T
- service class typeserviceClass
- Type of the service required.serviceClass
if the
container this invocation runs in supports that service,
otherwise null
.public <T extends Oplet<I,O>,I,O> Invocation<T,I,O> addOpletInvocation(T oplet, int inputs, int outputs)
Invocation
associated with the specified oplet.T
- Oplet typeI
- Tuple type of input streamsO
- Tuple type of output streamsoplet
- the opletinputs
- the invocation's inputsoutputs
- the invocation's outputspublic void initialize()
public void start()
public void close()
public boolean hasActiveTasks()
true
if at least a user task is still active.public java.lang.Throwable getLastError()
Copyright © 2016 The Apache Software Foundation. All Rights Reserved - bbe71fa-20161201-1641