Search in sources :

Example 1 with ApplicationConfiguration

use of org.apache.flink.client.deployment.application.ApplicationConfiguration in project flink by apache.

the class KubernetesApplicationClusterEntrypoint method getPackagedProgram.

private static PackagedProgram getPackagedProgram(final Configuration configuration) throws FlinkException {
    final ApplicationConfiguration applicationConfiguration = ApplicationConfiguration.fromConfiguration(configuration);
    final PackagedProgramRetriever programRetriever = getPackagedProgramRetriever(configuration, applicationConfiguration.getProgramArguments(), applicationConfiguration.getApplicationClassName());
    return programRetriever.getPackagedProgram();
}
Also used : DefaultPackagedProgramRetriever(org.apache.flink.client.program.DefaultPackagedProgramRetriever) PackagedProgramRetriever(org.apache.flink.client.program.PackagedProgramRetriever) ApplicationConfiguration(org.apache.flink.client.deployment.application.ApplicationConfiguration)

Example 2 with ApplicationConfiguration

use of org.apache.flink.client.deployment.application.ApplicationConfiguration in project flink by apache.

the class CliFrontend method runApplication.

// --------------------------------------------------------------------------------------------
// Execute Actions
// --------------------------------------------------------------------------------------------
protected void runApplication(String[] args) throws Exception {
    LOG.info("Running 'run-application' command.");
    final Options commandOptions = CliFrontendParser.getRunCommandOptions();
    final CommandLine commandLine = getCommandLine(commandOptions, args, true);
    if (commandLine.hasOption(HELP_OPTION.getOpt())) {
        CliFrontendParser.printHelpForRunApplication(customCommandLines);
        return;
    }
    final CustomCommandLine activeCommandLine = validateAndGetActiveCommandLine(checkNotNull(commandLine));
    final ApplicationDeployer deployer = new ApplicationClusterDeployer(clusterClientServiceLoader);
    final ProgramOptions programOptions;
    final Configuration effectiveConfiguration;
    // No need to set a jarFile path for Pyflink job.
    if (ProgramOptionsUtils.isPythonEntryPoint(commandLine)) {
        programOptions = ProgramOptionsUtils.createPythonProgramOptions(commandLine);
        effectiveConfiguration = getEffectiveConfiguration(activeCommandLine, commandLine, programOptions, Collections.emptyList());
    } else {
        programOptions = new ProgramOptions(commandLine);
        programOptions.validate();
        final URI uri = PackagedProgramUtils.resolveURI(programOptions.getJarFilePath());
        effectiveConfiguration = getEffectiveConfiguration(activeCommandLine, commandLine, programOptions, Collections.singletonList(uri.toString()));
    }
    final ApplicationConfiguration applicationConfiguration = new ApplicationConfiguration(programOptions.getProgramArgs(), programOptions.getEntryPointClassName());
    deployer.run(effectiveConfiguration, applicationConfiguration);
}
Also used : JobManagerOptions(org.apache.flink.configuration.JobManagerOptions) Options(org.apache.commons.cli.Options) RestOptions(org.apache.flink.configuration.RestOptions) CoreOptions(org.apache.flink.configuration.CoreOptions) CommandLine(org.apache.commons.cli.CommandLine) ApplicationConfiguration(org.apache.flink.client.deployment.application.ApplicationConfiguration) SecurityConfiguration(org.apache.flink.runtime.security.SecurityConfiguration) Configuration(org.apache.flink.configuration.Configuration) GlobalConfiguration(org.apache.flink.configuration.GlobalConfiguration) ApplicationClusterDeployer(org.apache.flink.client.deployment.application.cli.ApplicationClusterDeployer) URI(java.net.URI) ApplicationConfiguration(org.apache.flink.client.deployment.application.ApplicationConfiguration)

Example 3 with ApplicationConfiguration

use of org.apache.flink.client.deployment.application.ApplicationConfiguration in project flink by apache.

the class YarnApplicationClusterEntryPoint method getPackagedProgram.

private static PackagedProgram getPackagedProgram(final Configuration configuration) throws FlinkException {
    final ApplicationConfiguration applicationConfiguration = ApplicationConfiguration.fromConfiguration(configuration);
    final PackagedProgramRetriever programRetriever = getPackagedProgramRetriever(configuration, applicationConfiguration.getProgramArguments(), applicationConfiguration.getApplicationClassName());
    return programRetriever.getPackagedProgram();
}
Also used : DefaultPackagedProgramRetriever(org.apache.flink.client.program.DefaultPackagedProgramRetriever) PackagedProgramRetriever(org.apache.flink.client.program.PackagedProgramRetriever) ApplicationConfiguration(org.apache.flink.client.deployment.application.ApplicationConfiguration)

Aggregations

ApplicationConfiguration (org.apache.flink.client.deployment.application.ApplicationConfiguration)3 DefaultPackagedProgramRetriever (org.apache.flink.client.program.DefaultPackagedProgramRetriever)2 PackagedProgramRetriever (org.apache.flink.client.program.PackagedProgramRetriever)2 URI (java.net.URI)1 CommandLine (org.apache.commons.cli.CommandLine)1 Options (org.apache.commons.cli.Options)1 ApplicationClusterDeployer (org.apache.flink.client.deployment.application.cli.ApplicationClusterDeployer)1 Configuration (org.apache.flink.configuration.Configuration)1 CoreOptions (org.apache.flink.configuration.CoreOptions)1 GlobalConfiguration (org.apache.flink.configuration.GlobalConfiguration)1 JobManagerOptions (org.apache.flink.configuration.JobManagerOptions)1 RestOptions (org.apache.flink.configuration.RestOptions)1 SecurityConfiguration (org.apache.flink.runtime.security.SecurityConfiguration)1