public class YarnClusterClient extends ClusterClient
ClusterClient.LazyActorSystemLoader
actorSystemLoader, flinkConfig, highAvailabilityServices, log, timeout
Constructor and Description |
---|
YarnClusterClient(AbstractYarnClusterDescriptor clusterDescriptor,
int numberTaskManagers,
int slotsPerTaskManager,
org.apache.hadoop.yarn.client.api.YarnClient yarnClient,
org.apache.hadoop.yarn.api.records.ApplicationReport appReport,
Configuration flinkConfig,
boolean newlyCreatedCluster)
Create a new Flink on YARN cluster.
|
Modifier and Type | Method and Description |
---|---|
void |
disconnect()
Disconnect from the Yarn cluster.
|
void |
finalizeCluster()
Shuts down or disconnects from the YARN cluster.
|
org.apache.hadoop.yarn.api.records.ApplicationId |
getApplicationId() |
ApplicationStatus |
getApplicationStatus() |
String |
getClusterIdentifier()
Returns a string representation of the cluster.
|
GetClusterStatusResponse |
getClusterStatus()
This method is only available if the cluster hasn't been started in detached mode.
|
Configuration |
getFlinkConfiguration()
Return the Flink configuration object.
|
int |
getMaxSlots()
The client may define an upper limit on the number of slots to use.
|
List<String> |
getNewMessages()
May return new messages from the cluster.
|
String |
getWebInterfaceURL()
Returns an URL (as a string) to the JobManager web interface.
|
boolean |
hasBeenShutdown() |
boolean |
hasUserJarsInClassPath(List<URL> userJarFiles)
Returns true if the client already has the user jar and providing it again would
result in duplicate uploading of the jar.
|
boolean |
isDetached()
A flag to indicate whether this clients submits jobs detached.
|
void |
shutdownCluster()
Shuts down the Yarn application.
|
protected JobSubmissionResult |
submitJob(JobGraph jobGraph,
ClassLoader classLoader)
Calls the subclasses' submitJob method.
|
void |
waitForClusterToBeReady()
Blocks until all TaskManagers are connected to the JobManager.
|
cancel, cancelWithSavepoint, connectToJob, endSession, endSessions, getAccumulators, getAccumulators, getJobGraph, getJobManagerAddress, getJobManagerGateway, getOptimizedPlan, getOptimizedPlan, getOptimizedPlanAsJson, getPrintStatusDuringExecution, listJobs, logAndSysout, retrieveJob, run, run, run, run, run, run, runDetached, setDetached, setPrintStatusDuringExecution, shutdown, stop, triggerSavepoint
public YarnClusterClient(AbstractYarnClusterDescriptor clusterDescriptor, int numberTaskManagers, int slotsPerTaskManager, org.apache.hadoop.yarn.client.api.YarnClient yarnClient, org.apache.hadoop.yarn.api.records.ApplicationReport appReport, Configuration flinkConfig, boolean newlyCreatedCluster) throws Exception
clusterDescriptor
- The descriptor used at cluster creationnumberTaskManagers
- The number of task managers, -1 if unknownslotsPerTaskManager
- Slots per task manager, -1 if unknownyarnClient
- Client to talk to YARNappReport
- the YARN application IDflinkConfig
- Flink configurationnewlyCreatedCluster
- Indicator whether this cluster has just been createdIOException
org.apache.hadoop.yarn.exceptions.YarnException
Exception
public void disconnect()
public Configuration getFlinkConfiguration()
ClusterClient
getFlinkConfiguration
in class ClusterClient
public int getMaxSlots()
ClusterClient
getMaxSlots
in class ClusterClient
public boolean hasUserJarsInClassPath(List<URL> userJarFiles)
ClusterClient
hasUserJarsInClassPath
in class ClusterClient
protected JobSubmissionResult submitJob(JobGraph jobGraph, ClassLoader classLoader) throws ProgramInvocationException
ClusterClient
submitJob
in class ClusterClient
jobGraph
- The JobGraph to be submittedProgramInvocationException
public String getWebInterfaceURL()
ClusterClient
getWebInterfaceURL
in class ClusterClient
public String getClusterIdentifier()
ClusterClient
getClusterIdentifier
in class ClusterClient
public GetClusterStatusResponse getClusterStatus()
getClusterStatus
in class ClusterClient
public ApplicationStatus getApplicationStatus()
public List<String> getNewMessages()
ClusterClient
getNewMessages
in class ClusterClient
public void finalizeCluster()
finalizeCluster
in class ClusterClient
public void shutdownCluster()
public boolean hasBeenShutdown()
public boolean isDetached()
ClusterClient
isDetached
in class ClusterClient
public void waitForClusterToBeReady()
waitForClusterToBeReady
in class ClusterClient
public org.apache.hadoop.yarn.api.records.ApplicationId getApplicationId()
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.