public class CliFrontend extends Object
Constructor and Description |
---|
CliFrontend() |
CliFrontend(String configDir) |
Modifier and Type | Method and Description |
---|---|
protected PackagedProgram |
buildProgram(ProgramOptions options)
Creates a Packaged program from the given command line options.
|
protected int |
cancel(String[] args)
Executes the CANCEL action.
|
protected ClusterClient |
createClient(CommandLineOptions options,
String programName)
Creates a
ClusterClient object from the given command line options and other parameters. |
protected int |
executeProgram(PackagedProgram program,
ClusterClient client,
int parallelism) |
CustomCommandLine |
getActiveCustomCommandLine(org.apache.commons.cli.CommandLine commandLine)
Gets the custom command-line for the arguments.
|
Configuration |
getConfiguration()
Getter which returns a copy of the associated configuration
|
static String |
getConfigurationDirectoryFromEnv() |
static List<CustomCommandLine> |
getCustomCommandLineList()
Retrieves the loaded custom command-lines.
|
protected ActorGateway |
getJobManagerGateway(CommandLineOptions options)
Retrieves the
ActorGateway for the JobManager. |
protected int |
info(String[] args)
Executes the info action.
|
protected int |
list(String[] args)
Executes the list action.
|
static void |
main(String[] args)
Submits the job based on the arguments
|
int |
parseParameters(String[] args)
Parses the command line arguments and starts the requested action.
|
protected ClusterClient |
retrieveClient(CommandLineOptions options)
Updates the associated configuration with the given command line options
|
protected int |
run(String[] args)
Executions the run action.
|
protected int |
savepoint(String[] args)
Executes the SAVEPOINT action.
|
static void |
setJobManagerAddressInConfig(Configuration config,
InetSocketAddress address)
Writes the given job manager address to the associated configuration object
|
protected int |
stop(String[] args)
Executes the STOP action.
|
public CliFrontend() throws Exception
Exception
- Thrown if the configuration directory was not found, the configuration could not be loadedpublic Configuration getConfiguration()
protected int run(String[] args)
args
- Command line arguments for the run action.protected int info(String[] args)
args
- Command line arguments for the info action.protected int list(String[] args)
args
- Command line arguments for the list action.protected int stop(String[] args)
args
- Command line arguments for the stop action.protected int cancel(String[] args)
args
- Command line arguments for the cancel action.protected int savepoint(String[] args)
args
- Command line arguments for the cancel action.protected int executeProgram(PackagedProgram program, ClusterClient client, int parallelism)
protected PackagedProgram buildProgram(ProgramOptions options) throws FileNotFoundException, ProgramInvocationException
FileNotFoundException
ProgramInvocationException
protected ClusterClient retrieveClient(CommandLineOptions options)
options
- Command line optionsprotected ActorGateway getJobManagerGateway(CommandLineOptions options) throws Exception
ActorGateway
for the JobManager. The ClusterClient is retrieved
from the provided CommandLineOptions
.options
- CommandLineOptions specifying the JobManager URLException
protected ClusterClient createClient(CommandLineOptions options, String programName) throws Exception
ClusterClient
object from the given command line options and other parameters.options
- Command line optionsprogramName
- Program nameException
public int parseParameters(String[] args)
args
- command line arguments of the client.public static void main(String[] args)
public static String getConfigurationDirectoryFromEnv()
public static void setJobManagerAddressInConfig(Configuration config, InetSocketAddress address)
address
- Address to write to the configurationconfig
- The config to write topublic CustomCommandLine getActiveCustomCommandLine(org.apache.commons.cli.CommandLine commandLine)
commandLine
- The input to the command-line.public static List<CustomCommandLine> getCustomCommandLineList()
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.