public class DefaultCLI extends AbstractCustomCommandLine<StandaloneClusterId>
addressOption, configuration, zookeeperNamespaceOption
Constructor and Description |
---|
DefaultCLI(Configuration configuration) |
Modifier and Type | Method and Description |
---|---|
void |
addGeneralOptions(org.apache.commons.cli.Options baseOptions)
Adds custom options to the existing general options.
|
StandaloneClusterDescriptor |
createClusterDescriptor(org.apache.commons.cli.CommandLine commandLine)
Create a
ClusterDescriptor from the given configuration, configuration directory
and the command line. |
StandaloneClusterId |
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. |
String |
getId()
Gets the unique identifier of this CustomCommandLine.
|
boolean |
isActive(org.apache.commons.cli.CommandLine commandLine)
Signals whether the custom command-line wants to execute or not.
|
addRunOptions, applyCommandLineOptionsToConfiguration, getConfiguration
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
parseCommandLineOptions
public DefaultCLI(Configuration configuration)
public boolean isActive(org.apache.commons.cli.CommandLine commandLine)
CustomCommandLine
commandLine
- The command-line optionspublic String getId()
CustomCommandLine
public void addGeneralOptions(org.apache.commons.cli.Options baseOptions)
CustomCommandLine
addGeneralOptions
in interface CustomCommandLine<StandaloneClusterId>
addGeneralOptions
in class AbstractCustomCommandLine<StandaloneClusterId>
baseOptions
- The existing options.public StandaloneClusterDescriptor 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 StandaloneClusterId 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)
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 ClusterSpecificationCopyright © 2014–2020 The Apache Software Foundation. All rights reserved.