Search in sources :

Example 1 with YarnDeploymentTarget

use of org.apache.flink.yarn.configuration.YarnDeploymentTarget in project flink by apache.

the class YarnClusterDescriptor method deployApplicationCluster.

@Override
public ClusterClientProvider<ApplicationId> deployApplicationCluster(final ClusterSpecification clusterSpecification, final ApplicationConfiguration applicationConfiguration) throws ClusterDeploymentException {
    checkNotNull(clusterSpecification);
    checkNotNull(applicationConfiguration);
    final YarnDeploymentTarget deploymentTarget = YarnDeploymentTarget.fromConfig(flinkConfiguration);
    if (YarnDeploymentTarget.APPLICATION != deploymentTarget) {
        throw new ClusterDeploymentException("Couldn't deploy Yarn Application Cluster." + " Expected deployment.target=" + YarnDeploymentTarget.APPLICATION.getName() + " but actual one was \"" + deploymentTarget.getName() + "\"");
    }
    applicationConfiguration.applyToConfiguration(flinkConfiguration);
    final List<String> pipelineJars = flinkConfiguration.getOptional(PipelineOptions.JARS).orElse(Collections.emptyList());
    Preconditions.checkArgument(pipelineJars.size() == 1, "Should only have one jar");
    try {
        return deployInternal(clusterSpecification, "Flink Application Cluster", YarnApplicationClusterEntryPoint.class.getName(), null, false);
    } catch (Exception e) {
        throw new ClusterDeploymentException("Couldn't deploy Yarn Application Cluster", e);
    }
}
Also used : ClusterDeploymentException(org.apache.flink.client.deployment.ClusterDeploymentException) YarnApplicationClusterEntryPoint(org.apache.flink.yarn.entrypoint.YarnApplicationClusterEntryPoint) YarnDeploymentTarget(org.apache.flink.yarn.configuration.YarnDeploymentTarget) InvocationTargetException(java.lang.reflect.InvocationTargetException) FlinkException(org.apache.flink.util.FlinkException) IOException(java.io.IOException) ClusterDeploymentException(org.apache.flink.client.deployment.ClusterDeploymentException) UnsupportedEncodingException(java.io.UnsupportedEncodingException) IllegalConfigurationException(org.apache.flink.configuration.IllegalConfigurationException) YarnException(org.apache.hadoop.yarn.exceptions.YarnException) ClusterRetrieveException(org.apache.flink.client.deployment.ClusterRetrieveException)

Aggregations

IOException (java.io.IOException)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 ClusterDeploymentException (org.apache.flink.client.deployment.ClusterDeploymentException)1 ClusterRetrieveException (org.apache.flink.client.deployment.ClusterRetrieveException)1 IllegalConfigurationException (org.apache.flink.configuration.IllegalConfigurationException)1 FlinkException (org.apache.flink.util.FlinkException)1 YarnDeploymentTarget (org.apache.flink.yarn.configuration.YarnDeploymentTarget)1 YarnApplicationClusterEntryPoint (org.apache.flink.yarn.entrypoint.YarnApplicationClusterEntryPoint)1 YarnException (org.apache.hadoop.yarn.exceptions.YarnException)1