public class FlinkYarnSessionCli extends Object implements CustomCommandLine<YarnClusterClient>
Modifier and Type | Field and Description |
---|---|
static String |
CONFIG_FILE_LOG4J_NAME |
static String |
CONFIG_FILE_LOGBACK_NAME |
Constructor and Description |
---|
FlinkYarnSessionCli(String shortPrefix,
String longPrefix) |
FlinkYarnSessionCli(String shortPrefix,
String longPrefix,
boolean acceptInteractiveInput) |
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.
|
YarnClusterClient |
createCluster(String applicationName,
org.apache.commons.cli.CommandLine cmdLine,
Configuration config,
List<URL> userJarFiles)
Creates the client for the cluster
|
AbstractYarnClusterDescriptor |
createDescriptor(String defaultApplicationName,
org.apache.commons.cli.CommandLine cmd) |
protected AbstractYarnClusterDescriptor |
getClusterDescriptor() |
static Map<String,String> |
getDynamicProperties(String dynamicPropertiesEncoded) |
String |
getId()
Gets the unique identifier of this CustomCommandLine
|
static File |
getYarnPropertiesLocation(Configuration conf) |
boolean |
isActive(org.apache.commons.cli.CommandLine commandLine,
Configuration configuration)
Signals whether the custom command-line wants to execute or not
|
static void |
main(String[] args) |
YarnClusterClient |
retrieveCluster(org.apache.commons.cli.CommandLine cmdLine,
Configuration config)
Retrieves a client for a running cluster
|
int |
run(String[] args) |
static void |
runInteractiveCli(YarnClusterClient yarnCluster,
boolean readConsoleInput) |
void |
stop()
Utility method for tests.
|
public static final String CONFIG_FILE_LOGBACK_NAME
public static final String CONFIG_FILE_LOG4J_NAME
public AbstractYarnClusterDescriptor createDescriptor(String defaultApplicationName, org.apache.commons.cli.CommandLine cmd)
public static void runInteractiveCli(YarnClusterClient yarnCluster, boolean readConsoleInput)
public boolean isActive(org.apache.commons.cli.CommandLine commandLine, Configuration configuration)
CustomCommandLine
isActive
in interface CustomCommandLine<YarnClusterClient>
commandLine
- The command-line optionsconfiguration
- The Flink configurationpublic String getId()
CustomCommandLine
getId
in interface CustomCommandLine<YarnClusterClient>
public void addRunOptions(org.apache.commons.cli.Options baseOptions)
CustomCommandLine
addRunOptions
in interface CustomCommandLine<YarnClusterClient>
baseOptions
- The existing options.public void addGeneralOptions(org.apache.commons.cli.Options baseOptions)
CustomCommandLine
addGeneralOptions
in interface CustomCommandLine<YarnClusterClient>
baseOptions
- The existing options.public YarnClusterClient retrieveCluster(org.apache.commons.cli.CommandLine cmdLine, Configuration config) throws UnsupportedOperationException
CustomCommandLine
retrieveCluster
in interface CustomCommandLine<YarnClusterClient>
cmdLine
- The command-line parameters from the CliFrontendconfig
- The Flink configUnsupportedOperationException
- if the operation is not supportedpublic YarnClusterClient createCluster(String applicationName, org.apache.commons.cli.CommandLine cmdLine, Configuration config, List<URL> userJarFiles)
CustomCommandLine
createCluster
in interface CustomCommandLine<YarnClusterClient>
applicationName
- The application name to usecmdLine
- The command-line options parsed by the CliFrontendconfig
- The Flink config to useuserJarFiles
- User jar files to include in the classpath of the cluster.public int run(String[] args)
public void stop()
public static Map<String,String> getDynamicProperties(String dynamicPropertiesEncoded)
public static File getYarnPropertiesLocation(Configuration conf)
protected AbstractYarnClusterDescriptor getClusterDescriptor()
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.