@InterfaceStability.Unstable public abstract class ApplicationRunner extends java.lang.Object
StreamApplication
at runtime.Constructor and Description |
---|
ApplicationRunner(Config config) |
Modifier and Type | Method and Description |
---|---|
static ApplicationRunner |
fromConfig(Config config)
Static method to load the
ApplicationRunner |
abstract StreamSpec |
getStreamSpec(java.lang.String streamId)
Constructs a
StreamSpec from the configuration for the specified streamId. |
abstract void |
kill(StreamApplication streamApp)
Kill the Samza jobs represented by
StreamApplication
It is non-blocking so it doesn't wait for the application stopping. |
abstract void |
run(StreamApplication streamApp)
Deploy and run the Samza jobs to execute
StreamApplication . |
abstract ApplicationStatus |
status(StreamApplication streamApp)
Get the collective status of the Samza jobs represented by
StreamApplication . |
protected final Config config
public ApplicationRunner(Config config)
public static ApplicationRunner fromConfig(Config config)
ApplicationRunner
config
- configuration passed in to initialize the Samza processesApplicationRunner
to run the user-defined stream applicationspublic abstract void run(StreamApplication streamApp)
StreamApplication
.
It is non-blocking so it doesn't wait for the application running.streamApp
- the user-defined StreamApplication
objectpublic abstract void kill(StreamApplication streamApp)
StreamApplication
It is non-blocking so it doesn't wait for the application stopping.streamApp
- the user-defined StreamApplication
objectpublic abstract ApplicationStatus status(StreamApplication streamApp)
StreamApplication
.
Returns ApplicationRunner
running if all jobs are running.streamApp
- the user-defined StreamApplication
objectpublic abstract StreamSpec getStreamSpec(java.lang.String streamId)
StreamSpec
from the configuration for the specified streamId.
The stream configurations are read from the following properties in the config:
streams.{$streamId}.*
job.default.system
streamId
- The logical identifier for the stream in Samza.StreamSpec
instance.