public class CliFrontend extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ACTION_INFO |
static String |
ACTION_RUN |
static String |
YARN_DEPLOY_JOBMANAGER
A special host name used to run a job by deploying Flink into a YARN cluster,
if this string is specified as the JobManager address
|
static String |
YARN_DYNAMIC_PROPERTIES_SEPARATOR |
static String |
YARN_PROPERTIES_DYNAMIC_PROPERTIES_STRING |
static String |
YARN_PROPERTIES_FILE |
static String |
YARN_PROPERTIES_JOBMANAGER_KEY |
static String |
YARN_PROPERTIES_PARALLELISM |
| Constructor and Description |
|---|
CliFrontend() |
CliFrontend(String configDir) |
| Modifier and Type | Method and Description |
|---|---|
protected PackagedProgram |
buildProgram(ProgramOptions options)
Creates a Packaged program from the given command line options.
|
protected int |
cancel(String[] args)
Executes the CANCEL action.
|
protected int |
executeProgramBlocking(PackagedProgram program,
Client client,
int parallelism) |
protected int |
executeProgramDetached(PackagedProgram program,
Client client,
int parallelism) |
protected Client |
getClient(CommandLineOptions options,
String programName,
int userParallelism)
Retrieves a
Client object from the given command line options and other parameters. |
Configuration |
getConfiguration()
Getter which returns a copy of the associated configuration
|
static String |
getConfigurationDirectoryFromEnv() |
static List<Tuple2<String,String>> |
getDynamicProperties(String dynamicPropertiesEncoded) |
FlinkPlan |
getFlinkPlan() |
protected ActorGateway |
getJobManagerGateway(CommandLineOptions options)
Retrieves the
ActorGateway for the JobManager. |
PackagedProgram |
getPackagedProgram() |
protected int |
info(String[] args)
Executes the info action.
|
protected int |
list(String[] args)
Executes the list action.
|
static void |
main(String[] args)
Submits the job based on the arguments
|
int |
parseParameters(String[] args)
Parses the command line arguments and starts the requested action.
|
protected int |
run(String[] args)
Executions the run action.
|
void |
shutdown() |
protected void |
updateConfig(CommandLineOptions options)
Updates the associated configuration with the given command line options
|
protected void |
writeJobManagerAddressToConfig(InetSocketAddress address)
Writes the given job manager address to the associated configuration object
|
public static final String ACTION_RUN
public static final String ACTION_INFO
public static final String YARN_PROPERTIES_FILE
public static final String YARN_PROPERTIES_JOBMANAGER_KEY
public static final String YARN_PROPERTIES_PARALLELISM
public static final String YARN_PROPERTIES_DYNAMIC_PROPERTIES_STRING
public static final String YARN_DYNAMIC_PROPERTIES_SEPARATOR
public static final String YARN_DEPLOY_JOBMANAGER
public CliFrontend()
throws Exception
Exception - Thrown if the configuration directory was not found, the configuration could not
be loaded, or the YARN properties could not be parsed.public Configuration getConfiguration()
protected int run(String[] args)
args - Command line arguments for the run action.protected int info(String[] args)
args - Command line arguments for the info action.protected int list(String[] args)
args - Command line arguments for the list action.protected int cancel(String[] args)
args - Command line arguments for the cancel action.protected int executeProgramDetached(PackagedProgram program, Client client, int parallelism)
protected int executeProgramBlocking(PackagedProgram program, Client client, int parallelism)
protected PackagedProgram buildProgram(ProgramOptions options) throws FileNotFoundException, ProgramInvocationException
FileNotFoundExceptionProgramInvocationExceptionprotected void writeJobManagerAddressToConfig(InetSocketAddress address)
address - Address to write to the configurationprotected void updateConfig(CommandLineOptions options)
options - Command line optionsprotected ActorGateway getJobManagerGateway(CommandLineOptions options) throws Exception
ActorGateway for the JobManager. The JobManager address is retrieved
from the provided CommandLineOptions.options - CommandLineOptions specifying the JobManager URLExceptionprotected Client getClient(CommandLineOptions options, String programName, int userParallelism) throws Exception
Client object from the given command line options and other parameters.options - Command line options which contain JobManager addressprogramName - Program nameuserParallelism - Given user parallelismExceptionpublic int parseParameters(String[] args)
args - command line arguments of the client.public FlinkPlan getFlinkPlan()
public PackagedProgram getPackagedProgram()
public void shutdown()
public static void main(String[] args)
public static String getConfigurationDirectoryFromEnv()
Copyright © 2014–2016 The Apache Software Foundation. All rights reserved.