public class LineInvoker extends Object
LineTableEnvironment
.Constructor and Description |
---|
LineInvoker(String toolName,
ObjectFactory<Task> taskFactory)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static String |
getParamHelp(TableEnvironment env,
String taskName,
Parameter<?> param)
Returns a help string for a parameter of one of the tasks known
to this application.
|
static String |
getPrefixedParameterUsage(Parameter<?>[] params,
String prefix)
Returns a usage string for a set of parameters,
prefixed by a given string.
|
static String |
getStackSummary(Throwable error)
Returns a truncated version of a stack trace for user consumption.
|
static String |
getUnusedWarning(String[] unused)
Returns a warning string appropriate for the case when one or more
words on the command line are never used by a task.
|
int |
invoke(String[] args,
Runnable loggedConfig)
Invokes one of the known tasks given a string of command-line words.
|
public LineInvoker(String toolName, ObjectFactory<Task> taskFactory)
toolName
- name of the overall applicationtaskFactory
- factory which can create the tasks known to
the applicationpublic int invoke(String[] args, Runnable loggedConfig)
args
string will typically come straight out of
a static main()
method.
A callback may be supplied to perform configuration that has to
be done after logging configuration - presumably because it
does some logging itself. It is executed synchronously.args
- argument listloggedConfig
- callback for configuration to be done after
logging configuration (may be null)public static String getStackSummary(Throwable error)
error
- exception to summarisepublic static String getPrefixedParameterUsage(Parameter<?>[] params, String prefix)
params
- parameter arrayprefix
- string to prepend to the first linepublic static String getParamHelp(TableEnvironment env, String taskName, Parameter<?> param)
env
- execution environmenttaskName
- task nickname - may be null if heading is not requiredparam
- parameter for which usage information is requiredCopyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.