Package org.apache.flink.client.cli
Class CliFrontend
java.lang.Object
org.apache.flink.client.cli.CliFrontend
Implementation of a simple command line frontend for executing programs.
-
Constructor Summary
ConstructorsConstructorDescriptionCliFrontend(org.apache.flink.configuration.Configuration configuration, List<CustomCommandLine> customCommandLines) CliFrontend(org.apache.flink.configuration.Configuration configuration, ClusterClientServiceLoader clusterClientServiceLoader, List<CustomCommandLine> customCommandLines) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidExecutes 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.ConfigurationGetter which returns a copy of the associated configuration.static Stringorg.apache.commons.cli.Optionsprotected voidExecutes the info action.protected booleanisDeploymentTargetApplication(CustomCommandLine activeCustomCommandLine, org.apache.commons.cli.CommandLine commandLine) protected voidExecutes the list action.static List<CustomCommandLine>loadCustomCommandLines(org.apache.flink.configuration.Configuration configuration, String configurationDirectory) static voidSubmits the job based on the arguments.intparseAndRun(String[] args) Parses the command line arguments and starts the requested action.protected voidExecutions the run action.protected voidExecutes the SAVEPOINT action.protected voidExecutes the STOP action.validateAndGetActiveCommandLine(org.apache.commons.cli.CommandLine commandLine) Gets the custom command-line for the arguments.
-
Constructor Details
-
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 Details
-
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
Executions the run action.- Parameters:
args- Command line arguments for the run action.- Throws:
Exception
-
isDeploymentTargetApplication
protected boolean isDeploymentTargetApplication(CustomCommandLine activeCustomCommandLine, org.apache.commons.cli.CommandLine commandLine) throws org.apache.flink.util.FlinkException - Throws:
org.apache.flink.util.FlinkException
-
info
Executes the info action.- Parameters:
args- Command line arguments for the info action.- Throws:
Exception
-
list
Executes the list action.- Parameters:
args- Command line arguments for the list action.- Throws:
Exception
-
stop
Executes the STOP action.- Parameters:
args- Command line arguments for the stop action.- Throws:
Exception
-
cancel
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
Executes the SAVEPOINT action.- Parameters:
args- Command line arguments for the savepoint action.- Throws:
Exception
-
checkpoint
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
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
Submits the job based on the arguments. -
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)
-