Package org.apache.flink.client.cli
Class CliFrontend
- java.lang.Object
-
- org.apache.flink.client.cli.CliFrontend
-
public class CliFrontend extends Object
Implementation of a simple command line frontend for executing programs.
-
-
Constructor Summary
Constructors Constructor Description CliFrontend(org.apache.flink.configuration.Configuration configuration, List<CustomCommandLine> customCommandLines)CliFrontend(org.apache.flink.configuration.Configuration configuration, ClusterClientServiceLoader clusterClientServiceLoader, List<CustomCommandLine> customCommandLines)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcancel(String[] args)Executes the CANCEL action.protected voidcheckpoint(String[] args)Executes the CHECKPOINT action.protected voidexecuteProgram(org.apache.flink.configuration.Configuration configuration, PackagedProgram program)org.apache.commons.cli.CommandLinegetCommandLine(org.apache.commons.cli.Options commandOptions, String[] args, boolean stopAtNonOptions)org.apache.flink.configuration.ConfigurationgetConfiguration()Getter which returns a copy of the associated configuration.static StringgetConfigurationDirectoryFromEnv()org.apache.commons.cli.OptionsgetCustomCommandLineOptions()protected voidinfo(String[] args)Executes the info action.protected voidlist(String[] args)Executes the list action.static List<CustomCommandLine>loadCustomCommandLines(org.apache.flink.configuration.Configuration configuration, String configurationDirectory)static voidmain(String[] args)Submits the job based on the arguments.intparseAndRun(String[] args)Parses the command line arguments and starts the requested action.protected voidrun(String[] args)Executions the run action.protected voidrunApplication(String[] args)protected voidsavepoint(String[] args)Executes the SAVEPOINT action.protected voidstop(String[] args)Executes the STOP action.CustomCommandLinevalidateAndGetActiveCommandLine(org.apache.commons.cli.CommandLine commandLine)Gets the custom command-line for the arguments.
-
-
-
Constructor Detail
-
CliFrontend
public CliFrontend(org.apache.flink.configuration.Configuration configuration, List<CustomCommandLine> customCommandLines)
-
CliFrontend
public CliFrontend(org.apache.flink.configuration.Configuration configuration, ClusterClientServiceLoader clusterClientServiceLoader, List<CustomCommandLine> customCommandLines)
-
-
Method Detail
-
getConfiguration
public org.apache.flink.configuration.Configuration getConfiguration()
Getter which returns a copy of the associated configuration.- Returns:
- Copy of the associated configuration
-
getCustomCommandLineOptions
public org.apache.commons.cli.Options getCustomCommandLineOptions()
-
run
protected void run(String[] args) throws Exception
Executions the run action.- Parameters:
args- Command line arguments for the run action.- Throws:
Exception
-
info
protected void info(String[] args) throws Exception
Executes the info action.- Parameters:
args- Command line arguments for the info action.- Throws:
Exception
-
list
protected void list(String[] args) throws Exception
Executes the list action.- Parameters:
args- Command line arguments for the list action.- Throws:
Exception
-
stop
protected void stop(String[] args) throws Exception
Executes the STOP action.- Parameters:
args- Command line arguments for the stop action.- Throws:
Exception
-
cancel
protected void cancel(String[] args) throws Exception
Executes the CANCEL action.- Parameters:
args- Command line arguments for the cancel action.- Throws:
Exception
-
getCommandLine
public org.apache.commons.cli.CommandLine getCommandLine(org.apache.commons.cli.Options commandOptions, String[] args, boolean stopAtNonOptions) throws CliArgsException- Throws:
CliArgsException
-
savepoint
protected void savepoint(String[] args) throws Exception
Executes the SAVEPOINT action.- Parameters:
args- Command line arguments for the savepoint action.- Throws:
Exception
-
checkpoint
protected void checkpoint(String[] args) throws Exception
Executes the CHECKPOINT action.- Parameters:
args- Command line arguments for the checkpoint action.- Throws:
Exception
-
executeProgram
protected void executeProgram(org.apache.flink.configuration.Configuration configuration, PackagedProgram program) throws ProgramInvocationException- Throws:
ProgramInvocationException
-
parseAndRun
public int parseAndRun(String[] args)
Parses the command line arguments and starts the requested action.- Parameters:
args- command line arguments of the client.- Returns:
- The return code of the program
-
main
public static void main(String[] args)
Submits the job based on the arguments.
-
getConfigurationDirectoryFromEnv
public static String getConfigurationDirectoryFromEnv()
-
loadCustomCommandLines
public static List<CustomCommandLine> loadCustomCommandLines(org.apache.flink.configuration.Configuration configuration, String configurationDirectory)
-
validateAndGetActiveCommandLine
public CustomCommandLine validateAndGetActiveCommandLine(org.apache.commons.cli.CommandLine commandLine)
Gets the custom command-line for the arguments.- Parameters:
commandLine- The input to the command-line.- Returns:
- custom command-line which is active (may only be one at a time)
-
-