public class YarnClusterClientV2 extends ClusterClient
ClusterClient.LazyActorSystemLoader
actorSystemLoader, flinkConfig, highAvailabilityServices, log, timeout
Constructor and Description |
---|
YarnClusterClientV2(AbstractYarnClusterDescriptor clusterDescriptor,
Configuration flinkConfig)
Create a client to communicate with YARN cluster.
|
Modifier and Type | Method and Description |
---|---|
void |
finalizeCluster()
Request the cluster to shut down or disconnect.
|
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.
|
InetSocketAddress |
getJobManagerAddress()
Gets the current JobManager address (may change in case of a HA setup).
|
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 |
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.
|
protected JobSubmissionResult |
submitJob(JobGraph jobGraph,
ClassLoader classLoader)
Calls the subclasses' submitJob method.
|
void |
waitForClusterToBeReady()
Blocks until the client has determined that the cluster is ready for Job submission.
|
cancel, cancelWithSavepoint, connectToJob, endSession, endSessions, getAccumulators, getAccumulators, getJobGraph, getJobManagerGateway, getOptimizedPlan, getOptimizedPlan, getOptimizedPlanAsJson, getPrintStatusDuringExecution, listJobs, logAndSysout, retrieveJob, run, run, run, run, run, run, runDetached, setDetached, setPrintStatusDuringExecution, shutdown, stop, triggerSavepoint
public YarnClusterClientV2(AbstractYarnClusterDescriptor clusterDescriptor, Configuration flinkConfig) throws Exception
clusterDescriptor
- The descriptor used to create yarn jobflinkConfig
- Flink configurationException
- if the cluster client could not be createdpublic 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()
ClusterClient
finalizeCluster
in class ClusterClient
public boolean isDetached()
ClusterClient
isDetached
in class ClusterClient
public void waitForClusterToBeReady()
ClusterClient
This is delayed until right before job submission to report any other errors first (e.g. invalid job definitions/errors in the user jar)
waitForClusterToBeReady
in class ClusterClient
public InetSocketAddress getJobManagerAddress()
ClusterClient
getJobManagerAddress
in class ClusterClient
public org.apache.hadoop.yarn.api.records.ApplicationId getApplicationId()
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.