public class FlinkYarnCLI extends Object implements CustomCommandLine<YarnClusterClientV2>
Constructor and Description |
---|
FlinkYarnCLI(String shortPrefix,
String longPrefix) |
Modifier and Type | Method and Description |
---|---|
void |
addGeneralOptions(org.apache.commons.cli.Options baseOptions)
Adds custom options to the existing general options.
|
void |
addRunOptions(org.apache.commons.cli.Options baseOptions)
Adds custom options to the existing run options.
|
YarnClusterClientV2 |
createCluster(String applicationName,
org.apache.commons.cli.CommandLine cmdLine,
Configuration config,
String configurationDirectory,
List<URL> userJarFiles)
Creates the client for the cluster.
|
YarnClusterDescriptorV2 |
createDescriptor(Configuration configuration,
String defaultApplicationName,
org.apache.commons.cli.CommandLine cmd) |
String |
getId()
Gets the unique identifier of this CustomCommandLine.
|
boolean |
isActive(org.apache.commons.cli.CommandLine commandLine,
Configuration configuration)
Signals whether the custom command-line wants to execute or not.
|
YarnClusterClientV2 |
retrieveCluster(org.apache.commons.cli.CommandLine cmdLine,
Configuration config,
String configurationDirectory)
Retrieves a client for a running cluster.
|
public YarnClusterDescriptorV2 createDescriptor(Configuration configuration, String defaultApplicationName, org.apache.commons.cli.CommandLine cmd)
public boolean isActive(org.apache.commons.cli.CommandLine commandLine, Configuration configuration)
CustomCommandLine
isActive
in interface CustomCommandLine<YarnClusterClientV2>
commandLine
- The command-line optionsconfiguration
- The Flink configurationpublic String getId()
CustomCommandLine
getId
in interface CustomCommandLine<YarnClusterClientV2>
public void addRunOptions(org.apache.commons.cli.Options baseOptions)
CustomCommandLine
addRunOptions
in interface CustomCommandLine<YarnClusterClientV2>
baseOptions
- The existing options.public void addGeneralOptions(org.apache.commons.cli.Options baseOptions)
CustomCommandLine
addGeneralOptions
in interface CustomCommandLine<YarnClusterClientV2>
baseOptions
- The existing options.public YarnClusterClientV2 retrieveCluster(org.apache.commons.cli.CommandLine cmdLine, Configuration config, String configurationDirectory) throws UnsupportedOperationException
CustomCommandLine
retrieveCluster
in interface CustomCommandLine<YarnClusterClientV2>
cmdLine
- The command-line parameters from the CliFrontendconfig
- The Flink configconfigurationDirectory
- Directory for configuration filesUnsupportedOperationException
- if the operation is not supportedpublic YarnClusterClientV2 createCluster(String applicationName, org.apache.commons.cli.CommandLine cmdLine, Configuration config, String configurationDirectory, List<URL> userJarFiles) throws Exception
CustomCommandLine
createCluster
in interface CustomCommandLine<YarnClusterClientV2>
applicationName
- The application name to usecmdLine
- The command-line options parsed by the CliFrontendconfig
- The Flink config to useconfigurationDirectory
- Directory for configuration filesuserJarFiles
- User jar files to include in the classpath of the cluster. @return The client to communicate with the cluster which the CustomCommandLine brought up.Exception
- if the cluster could not be createdCopyright © 2014–2018 The Apache Software Foundation. All rights reserved.