public class FlinkYarnSessionCli extends AbstractCustomCommandLine<org.apache.hadoop.yarn.api.records.ApplicationId>
Modifier and Type | Field and Description |
---|---|
static String |
CONFIG_FILE_LOG4J_NAME |
static String |
CONFIG_FILE_LOGBACK_NAME |
addressOption, configuration, zookeeperNamespaceOption
Constructor and Description |
---|
FlinkYarnSessionCli(Configuration configuration,
String configurationDirectory,
String shortPrefix,
String longPrefix) |
FlinkYarnSessionCli(Configuration configuration,
String configurationDirectory,
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.
|
protected Configuration |
applyCommandLineOptionsToConfiguration(org.apache.commons.cli.CommandLine commandLine)
Override configuration settings by specified command line options.
|
AbstractYarnClusterDescriptor |
createClusterDescriptor(org.apache.commons.cli.CommandLine commandLine)
Create a
ClusterDescriptor from the given configuration, configuration directory
and the command line. |
org.apache.hadoop.yarn.api.records.ApplicationId |
getClusterId(org.apache.commons.cli.CommandLine commandLine)
Returns the cluster id if a cluster id was specified on the command line, otherwise it
returns null.
|
ClusterSpecification |
getClusterSpecification(org.apache.commons.cli.CommandLine commandLine)
Returns the
ClusterSpecification specified by the configuration and the command
line options. |
static Map<String,String> |
getDynamicProperties(String dynamicPropertiesEncoded) |
String |
getId()
Gets the unique identifier of this CustomCommandLine.
|
static File |
getYarnPropertiesLocation(String yarnPropertiesFileLocation) |
boolean |
isActive(org.apache.commons.cli.CommandLine commandLine)
Signals whether the custom command-line wants to execute or not.
|
static void |
main(String[] args) |
int |
run(String[] args) |
getConfiguration
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
parseCommandLineOptions
public static final String CONFIG_FILE_LOGBACK_NAME
public static final String CONFIG_FILE_LOG4J_NAME
public FlinkYarnSessionCli(Configuration configuration, String configurationDirectory, String shortPrefix, String longPrefix) throws FlinkException
FlinkException
public FlinkYarnSessionCli(Configuration configuration, String configurationDirectory, String shortPrefix, String longPrefix, boolean acceptInteractiveInput) throws FlinkException
FlinkException
public boolean isActive(org.apache.commons.cli.CommandLine commandLine)
CustomCommandLine
commandLine
- The command-line optionspublic String getId()
CustomCommandLine
public void addRunOptions(org.apache.commons.cli.Options baseOptions)
CustomCommandLine
addRunOptions
in interface CustomCommandLine<org.apache.hadoop.yarn.api.records.ApplicationId>
addRunOptions
in class AbstractCustomCommandLine<org.apache.hadoop.yarn.api.records.ApplicationId>
baseOptions
- The existing options.public void addGeneralOptions(org.apache.commons.cli.Options baseOptions)
CustomCommandLine
addGeneralOptions
in interface CustomCommandLine<org.apache.hadoop.yarn.api.records.ApplicationId>
addGeneralOptions
in class AbstractCustomCommandLine<org.apache.hadoop.yarn.api.records.ApplicationId>
baseOptions
- The existing options.public AbstractYarnClusterDescriptor createClusterDescriptor(org.apache.commons.cli.CommandLine commandLine) throws FlinkException
CustomCommandLine
ClusterDescriptor
from the given configuration, configuration directory
and the command line.commandLine
- containing command line options relevant for the ClusterDescriptorFlinkException
- if the ClusterDescriptor could not be created@Nullable public org.apache.hadoop.yarn.api.records.ApplicationId getClusterId(org.apache.commons.cli.CommandLine commandLine)
CustomCommandLine
A cluster id identifies a running cluster, e.g. the Yarn application id for a Flink cluster running on Yarn.
commandLine
- containing command line options relevant for the cluster id retrievalpublic ClusterSpecification getClusterSpecification(org.apache.commons.cli.CommandLine commandLine) throws FlinkException
CustomCommandLine
ClusterSpecification
specified by the configuration and the command
line options. This specification can be used to deploy a new Flink cluster.commandLine
- containing command line options relevant for the ClusterSpecificationFlinkException
- if the ClusterSpecification could not be createdprotected Configuration applyCommandLineOptionsToConfiguration(org.apache.commons.cli.CommandLine commandLine) throws FlinkException
AbstractCustomCommandLine
applyCommandLineOptionsToConfiguration
in class AbstractCustomCommandLine<org.apache.hadoop.yarn.api.records.ApplicationId>
commandLine
- containing the overriding valuesFlinkException
public int run(String[] args) throws CliArgsException, FlinkException
CliArgsException
FlinkException
public static Map<String,String> getDynamicProperties(String dynamicPropertiesEncoded)
public static void main(String[] args)
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.