public interface TwillPreparer
| Modifier and Type | Method and Description |
|---|---|
TwillPreparer |
addJVMOptions(String options)
This methods adds extra JVM options that will be passed to the java command line for every runnable
of the application started through this
TwillPreparer instance. |
TwillPreparer |
addLogHandler(LogHandler handler)
Adds a
LogHandler for receiving an application log. |
TwillPreparer |
addSecureStore(SecureStore secureStore)
Adds security credentials for the runtime environment to gives application access to resources.
|
TwillPreparer |
enableDebugging(boolean doSuspend,
String... runnables)
Enable debugging for runnables.
|
TwillPreparer |
enableDebugging(String... runnables)
Enable debugging for runnables, without suspending the virtual machine to wait for the debugger.
|
TwillPreparer |
setJVMOptions(String options)
This methods sets the extra JVM options that will be passed to the java command line for every runnable
of the application started through this
TwillPreparer instance. |
TwillPreparer |
setLogLevel(LogEntry.Level logLevel)
Set the log level for Twill applications running in a container.
|
TwillPreparer |
setSchedulerQueue(String name)
Sets the name of the scheduler queue to use.
|
TwillPreparer |
setUser(String user)
Deprecated.
This method will be removed in future version.
|
TwillController |
start()
Starts the application.
|
TwillPreparer |
withApplicationArguments(Iterable<String> args)
Sets the list of arguments that will be passed to the application.
|
TwillPreparer |
withApplicationArguments(String... args)
Sets the list of arguments that will be passed to the application.
|
TwillPreparer |
withApplicationClassPaths(Iterable<String> classPaths)
Adds the set of paths to the classpath on the target machine for ApplicationMaster and all runnables.
|
TwillPreparer |
withApplicationClassPaths(String... classPaths)
Adds the set of paths to the classpath on the target machine for ApplicationMaster and all runnables.
|
TwillPreparer |
withArguments(String runnableName,
Iterable<String> args)
Sets the list of arguments that will be passed to the
TwillRunnable identified by the given name. |
TwillPreparer |
withArguments(String runnableName,
String... args)
Sets the list of arguments that will be passed to the
TwillRunnable identified by the given name. |
TwillPreparer |
withBundlerClassAcceptor(ClassAcceptor classAcceptor)
Uses
ClassAcceptor to determine the classes to include in the bundle jar for
ApplicationMaster and all runnables. |
TwillPreparer |
withClassPaths(Iterable<String> classPaths)
Adds the set of paths to the classpath on the target machine for all runnables.
|
TwillPreparer |
withClassPaths(String... classPaths)
Adds the set of paths to the classpath on the target machine for all runnables.
|
TwillPreparer |
withDependencies(Class<?>... classes)
Adds extra classes that the application is dependent on and is not traceable from the application itself.
|
TwillPreparer |
withDependencies(Iterable<Class<?>> classes)
Adds extra classes that the application is dependent on and is not traceable from the application itself.
|
TwillPreparer |
withEnv(Map<String,String> env)
Adds the set of environment variables that will be set as container environment variables for all runnables.
|
TwillPreparer |
withEnv(String runnableName,
Map<String,String> env)
Adds the set of environment variables that will be set as container environment variables for the given runnable.
|
TwillPreparer |
withResources(Iterable<URI> resources)
Adds resources that will be available through the ClassLoader of the
runnables. |
TwillPreparer |
withResources(URI... resources)
Adds resources that will be available through the ClassLoader of the
runnables. |
TwillPreparer addLogHandler(LogHandler handler)
LogHandler for receiving an application log.handler - The LogHandler.TwillPreparer.@Deprecated TwillPreparer setUser(String user)
"user.name" by calling
System.getProperty(String).user - User nameTwillPreparer.TwillPreparer setSchedulerQueue(String name)
name - Name of the scheduler queueTwillPreparer.TwillPreparer setJVMOptions(String options)
TwillPreparer instance.
This is intended for advance usage. All options will be passed unchanged to the java command line. Invalid
options could cause application not able to start.options - extra JVM options.TwillPreparer addJVMOptions(String options)
TwillPreparer instance.
This is intended for advance usage. All options will be passed unchanged to the java command line. Invalid
options could cause application not able to start.options - extra JVM options.TwillPreparer enableDebugging(String... runnables)
runnables - the names of runnables to enable for debugging. If empty, it means all runnables.TwillPreparer enableDebugging(boolean doSuspend, String... runnables)
doSuspend - whether the virtual machines should be supended until the debugger connects. This
option allows to debug a container from the very beginning. Note that in that case,
the container cannot notify the controller of its debug port until the debugger is
attached - you must figure out where it is running using the YARN console or APIs.runnables - the names of runnables to enable for debugging. If empty, it means all runnables.TwillPreparer withApplicationArguments(String... args)
TwillContext.getApplicationArguments().args - Array of arguments.TwillPreparer.TwillPreparer withApplicationArguments(Iterable<String> args)
TwillContext.getApplicationArguments().args - Iterable of arguments.TwillPreparer.TwillPreparer withArguments(String runnableName, String... args)
TwillRunnable identified by the given name.
The arguments can be retrieved from TwillContext.getArguments().runnableName - Name of the TwillRunnable.args - Array of arguments.TwillPreparer.TwillPreparer withArguments(String runnableName, Iterable<String> args)
TwillRunnable identified by the given name.
The arguments can be retrieved from TwillContext.getArguments().runnableName - Name of the TwillRunnable.args - Iterable of arguments.TwillPreparer.TwillPreparer withDependencies(Class<?>... classes)
TwillPreparer.withDependencies(Iterable)TwillPreparer withDependencies(Iterable<Class<?>> classes)
Class.forName(String).classes - set of classes to add to dependency list for generating the deployment jar.TwillPreparer.TwillPreparer withResources(URI... resources)
runnables.TwillPreparer.withResources(Iterable)TwillPreparer withResources(Iterable<URI> resources)
runnables.
Useful for adding extra resource files or libraries that are not traceable from the application itself.
If the URI is a jar file, classes inside would be loadable by the ClassLoader. If the URI is a directory,
everything underneath would be available.resources - Set of URI to the resources.TwillPreparer.TwillPreparer withClassPaths(String... classPaths)
TwillPreparerwithClassPaths(Iterable)TwillPreparer withClassPaths(Iterable<String> classPaths)
classPaths - Set of classpathsTwillPreparerTwillPreparer withEnv(Map<String,String> env)
env - set of environment variablesTwillPreparerTwillPreparer withEnv(String runnableName, Map<String,String> env)
withEnv(Map)
if there is a key clash.runnableName - Name of the TwillRunnable.env - set of environment variablesTwillPreparerTwillPreparer withApplicationClassPaths(String... classPaths)
TwillPreparerTwillPreparer withApplicationClassPaths(Iterable<String> classPaths)
TwillPreparerTwillPreparer withBundlerClassAcceptor(ClassAcceptor classAcceptor)
ClassAcceptor to determine the classes to include in the bundle jar for
ApplicationMaster and all runnables.classAcceptor - to specify which classes to include in the bundle jarTwillPreparerTwillPreparer addSecureStore(SecureStore secureStore)
secureStore - Contains security token available for the runtime environment.TwillPreparer.TwillPreparer setLogLevel(LogEntry.Level logLevel)
logLevel - the LogEntry.Level that should be set.
The level match the Logback levels.TwillPreparer.TwillController start()
TwillController for controlling the running application.Copyright © 2013-2016 The Apache Software Foundation. All rights reserved.