public abstract class AbstractYarnClusterDescriptor extends Object implements org.apache.flink.client.deployment.ClusterDescriptor<org.apache.hadoop.yarn.api.records.ApplicationId>
YarnClusterClient.| Modifier and Type | Field and Description |
|---|---|
protected List<File> |
shipFiles
Lazily initialized list of files to ship.
|
| Constructor and Description |
|---|
AbstractYarnClusterDescriptor(org.apache.flink.configuration.Configuration flinkConfiguration,
org.apache.hadoop.yarn.conf.YarnConfiguration yarnConfiguration,
String configurationDirectory,
org.apache.hadoop.yarn.client.api.YarnClient yarnClient,
boolean sharedYarnClient) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addLibFolderToShipFiles(Collection<File> effectiveShipFiles) |
void |
addShipFiles(List<File> shipFiles)
Adds the given files to the list of files to ship.
|
void |
close() |
protected abstract org.apache.flink.client.program.ClusterClient<org.apache.hadoop.yarn.api.records.ApplicationId> |
createYarnClusterClient(AbstractYarnClusterDescriptor descriptor,
int numberTaskManagers,
int slotsPerTaskManager,
org.apache.hadoop.yarn.api.records.ApplicationReport report,
org.apache.flink.configuration.Configuration flinkConfiguration,
boolean perJobCluster)
Creates a YarnClusterClient; may be overriden in tests.
|
protected org.apache.flink.client.program.ClusterClient<org.apache.hadoop.yarn.api.records.ApplicationId> |
deployInternal(org.apache.flink.client.deployment.ClusterSpecification clusterSpecification,
String applicationName,
String yarnClusterEntrypoint,
org.apache.flink.runtime.jobgraph.JobGraph jobGraph,
boolean detached)
This method will block until the ApplicationMaster/JobManager have been deployed on YARN.
|
org.apache.flink.client.program.ClusterClient<org.apache.hadoop.yarn.api.records.ApplicationId> |
deploySessionCluster(org.apache.flink.client.deployment.ClusterSpecification clusterSpecification) |
String |
getClusterDescription() |
String |
getDynamicPropertiesEncoded() |
org.apache.flink.configuration.Configuration |
getFlinkConfiguration() |
String |
getNodeLabel() |
org.apache.hadoop.yarn.client.api.YarnClient |
getYarnClient() |
protected abstract String |
getYarnJobClusterEntrypoint()
The class to start the application master with.
|
protected abstract String |
getYarnSessionClusterEntrypoint()
The class to start the application master with.
|
String |
getZookeeperNamespace() |
boolean |
hasUserJarFiles(List<URL> requiredJarFiles)
Returns true if the descriptor has the job jars to include in the classpath.
|
boolean |
isDetachedMode()
Deprecated.
The cluster descriptor should not know about this option.
|
void |
killCluster(org.apache.hadoop.yarn.api.records.ApplicationId applicationId) |
org.apache.flink.client.program.ClusterClient<org.apache.hadoop.yarn.api.records.ApplicationId> |
retrieve(org.apache.hadoop.yarn.api.records.ApplicationId applicationId) |
void |
setDetachedMode(boolean detachedMode)
Deprecated.
The cluster descriptor should not know about this option.
|
void |
setDynamicPropertiesEncoded(String dynamicPropertiesEncoded) |
void |
setLocalJarPath(org.apache.hadoop.fs.Path localJarPath) |
void |
setName(String name) |
void |
setNodeLabel(String nodeLabel) |
void |
setProvidedUserJarFiles(List<URL> userJarFiles)
Sets the user jar which is included in the system classloader of all nodes.
|
void |
setQueue(String queue) |
protected org.apache.hadoop.yarn.api.records.ContainerLaunchContext |
setupApplicationMasterContainer(String yarnClusterEntrypoint,
boolean hasLogback,
boolean hasLog4j,
boolean hasKrb5,
int jobManagerMemoryMb) |
void |
setZookeeperNamespace(String zookeeperNamespace) |
org.apache.hadoop.yarn.api.records.ApplicationReport |
startAppMaster(org.apache.flink.configuration.Configuration configuration,
String applicationName,
String yarnClusterEntrypoint,
org.apache.flink.runtime.jobgraph.JobGraph jobGraph,
org.apache.hadoop.yarn.client.api.YarnClient yarnClient,
org.apache.hadoop.yarn.client.api.YarnClientApplication yarnApplication,
org.apache.flink.client.deployment.ClusterSpecification clusterSpecification) |
protected org.apache.flink.client.deployment.ClusterSpecification |
validateClusterResources(org.apache.flink.client.deployment.ClusterSpecification clusterSpecification,
int yarnMinAllocationMB,
org.apache.hadoop.yarn.api.records.Resource maximumResourceCapability,
org.apache.flink.yarn.AbstractYarnClusterDescriptor.ClusterResourceDescription freeClusterResources) |
public AbstractYarnClusterDescriptor(org.apache.flink.configuration.Configuration flinkConfiguration,
org.apache.hadoop.yarn.conf.YarnConfiguration yarnConfiguration,
String configurationDirectory,
org.apache.hadoop.yarn.client.api.YarnClient yarnClient,
boolean sharedYarnClient)
public org.apache.hadoop.yarn.client.api.YarnClient getYarnClient()
protected abstract String getYarnSessionClusterEntrypoint()
protected abstract String getYarnJobClusterEntrypoint()
public org.apache.flink.configuration.Configuration getFlinkConfiguration()
public void setQueue(String queue)
public void setLocalJarPath(org.apache.hadoop.fs.Path localJarPath)
public void addShipFiles(List<File> shipFiles)
Note that any file matching "flink-dist*.jar" will be excluded from the upload by
uploadAndRegisterFiles(Collection, FileSystem, Path, ApplicationId, List, Map, StringBuilder)
since we upload the Flink uber jar ourselves and do not need to deploy it multiple times.
shipFiles - files to shippublic void setDynamicPropertiesEncoded(String dynamicPropertiesEncoded)
public boolean hasUserJarFiles(List<URL> requiredJarFiles)
public void setProvidedUserJarFiles(List<URL> userJarFiles)
public String getDynamicPropertiesEncoded()
@Deprecated public void setDetachedMode(boolean detachedMode)
@Deprecated public boolean isDetachedMode()
public String getZookeeperNamespace()
public void setZookeeperNamespace(String zookeeperNamespace)
public String getNodeLabel()
public void setNodeLabel(String nodeLabel)
public void close()
close in interface AutoCloseablepublic org.apache.flink.client.program.ClusterClient<org.apache.hadoop.yarn.api.records.ApplicationId> retrieve(org.apache.hadoop.yarn.api.records.ApplicationId applicationId)
throws org.apache.flink.client.deployment.ClusterRetrieveException
retrieve in interface org.apache.flink.client.deployment.ClusterDescriptor<org.apache.hadoop.yarn.api.records.ApplicationId>org.apache.flink.client.deployment.ClusterRetrieveExceptionpublic org.apache.flink.client.program.ClusterClient<org.apache.hadoop.yarn.api.records.ApplicationId> deploySessionCluster(org.apache.flink.client.deployment.ClusterSpecification clusterSpecification)
throws org.apache.flink.client.deployment.ClusterDeploymentException
deploySessionCluster in interface org.apache.flink.client.deployment.ClusterDescriptor<org.apache.hadoop.yarn.api.records.ApplicationId>org.apache.flink.client.deployment.ClusterDeploymentExceptionpublic void killCluster(org.apache.hadoop.yarn.api.records.ApplicationId applicationId)
throws org.apache.flink.util.FlinkException
killCluster in interface org.apache.flink.client.deployment.ClusterDescriptor<org.apache.hadoop.yarn.api.records.ApplicationId>org.apache.flink.util.FlinkExceptionprotected org.apache.flink.client.program.ClusterClient<org.apache.hadoop.yarn.api.records.ApplicationId> deployInternal(org.apache.flink.client.deployment.ClusterSpecification clusterSpecification,
String applicationName,
String yarnClusterEntrypoint,
@Nullable
org.apache.flink.runtime.jobgraph.JobGraph jobGraph,
boolean detached)
throws Exception
clusterSpecification - Initial cluster specification for the Flink cluster to be deployedapplicationName - name of the Yarn application to startyarnClusterEntrypoint - Class name of the Yarn cluster entry point.jobGraph - A job graph which is deployed with the Flink cluster, null if nonedetached - True if the cluster should be started in detached modeExceptionprotected org.apache.flink.client.deployment.ClusterSpecification validateClusterResources(org.apache.flink.client.deployment.ClusterSpecification clusterSpecification,
int yarnMinAllocationMB,
org.apache.hadoop.yarn.api.records.Resource maximumResourceCapability,
org.apache.flink.yarn.AbstractYarnClusterDescriptor.ClusterResourceDescription freeClusterResources)
throws org.apache.flink.yarn.AbstractYarnClusterDescriptor.YarnDeploymentException
org.apache.flink.yarn.AbstractYarnClusterDescriptor.YarnDeploymentExceptionpublic org.apache.hadoop.yarn.api.records.ApplicationReport startAppMaster(org.apache.flink.configuration.Configuration configuration,
String applicationName,
String yarnClusterEntrypoint,
org.apache.flink.runtime.jobgraph.JobGraph jobGraph,
org.apache.hadoop.yarn.client.api.YarnClient yarnClient,
org.apache.hadoop.yarn.client.api.YarnClientApplication yarnApplication,
org.apache.flink.client.deployment.ClusterSpecification clusterSpecification)
throws Exception
Exceptionpublic String getClusterDescription()
getClusterDescription in interface org.apache.flink.client.deployment.ClusterDescriptor<org.apache.hadoop.yarn.api.records.ApplicationId>public void setName(String name)
protected void addLibFolderToShipFiles(Collection<File> effectiveShipFiles)
protected org.apache.hadoop.yarn.api.records.ContainerLaunchContext setupApplicationMasterContainer(String yarnClusterEntrypoint, boolean hasLogback, boolean hasLog4j, boolean hasKrb5, int jobManagerMemoryMb)
protected abstract org.apache.flink.client.program.ClusterClient<org.apache.hadoop.yarn.api.records.ApplicationId> createYarnClusterClient(AbstractYarnClusterDescriptor descriptor, int numberTaskManagers, int slotsPerTaskManager, org.apache.hadoop.yarn.api.records.ApplicationReport report, org.apache.flink.configuration.Configuration flinkConfiguration, boolean perJobCluster) throws Exception
ExceptionCopyright © 2014–2019 The Apache Software Foundation. All rights reserved.