public class FlinkYarnCluster extends AbstractFlinkYarnCluster
Modifier and Type | Class and Description |
---|---|
class |
FlinkYarnCluster.ClientShutdownHook |
static class |
FlinkYarnCluster.PollingThread |
Constructor and Description |
---|
FlinkYarnCluster(org.apache.hadoop.yarn.client.api.YarnClient yarnClient,
org.apache.hadoop.yarn.api.records.ApplicationId appId,
org.apache.hadoop.conf.Configuration hadoopConfig,
Configuration flinkConfig,
org.apache.hadoop.fs.Path sessionFilesDir,
boolean detached)
Create a new Flink on YARN cluster.
|
Modifier and Type | Method and Description |
---|---|
void |
connectToCluster()
Connect the FlinkYarnCluster to the ApplicationMaster.
|
void |
disconnect()
Disconnect from the ApplicationMaster without stopping the session
(therefore, use the
AbstractFlinkYarnCluster.shutdown(boolean) method. |
String |
getApplicationId()
Returns a string representation of the ApplicationID assigned by YARN.
|
FlinkYarnClusterStatus |
getClusterStatus()
This method is only available if the cluster hasn't been started in detached mode.
|
String |
getDiagnostics() |
Configuration |
getFlinkConfiguration()
Return the Flink configuration object
|
InetSocketAddress |
getJobManagerAddress()
Get hostname and port of the JobManager.
|
List<String> |
getNewMessages()
May return new messages from the cluster.
|
String |
getWebInterfaceURL()
Returns an URL (as a string) to the JobManager web interface, running next to the
ApplicationMaster and JobManager in a YARN container
|
boolean |
hasBeenStopped()
Boolean indicating whether the cluster has been stopped already
|
boolean |
hasFailed()
Boolean indicating whether the Flink YARN cluster is in an erronous state.
|
boolean |
isDetached()
Flink's YARN cluster abstraction has two modes for connecting to the YARN AM.
|
void |
shutdown(boolean failApplication)
Shutdown the YARN cluster.
|
void |
stopAfterJob(JobID jobID)
Tells the ApplicationMaster to monitor the status of JobId and stop itself once the specified
job has finished.
|
public FlinkYarnCluster(org.apache.hadoop.yarn.client.api.YarnClient yarnClient, org.apache.hadoop.yarn.api.records.ApplicationId appId, org.apache.hadoop.conf.Configuration hadoopConfig, Configuration flinkConfig, org.apache.hadoop.fs.Path sessionFilesDir, boolean detached) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException
yarnClient
- Client to talk to YARNappId
- the YARN application IDhadoopConfig
- Hadoop configurationflinkConfig
- Flink configurationsessionFilesDir
- Location of files required for YARN sessiondetached
- Set to true if no actor system or RPC communication with the cluster should be establishedIOException
org.apache.hadoop.yarn.exceptions.YarnException
public void connectToCluster() throws IOException
connectToCluster
in class AbstractFlinkYarnCluster
IOException
public void disconnect()
AbstractFlinkYarnCluster
AbstractFlinkYarnCluster.shutdown(boolean)
method.disconnect
in class AbstractFlinkYarnCluster
AbstractFlinkYarnCluster.shutdown(boolean)
public void stopAfterJob(JobID jobID)
AbstractFlinkYarnCluster
stopAfterJob
in class AbstractFlinkYarnCluster
jobID
- Id of the jobpublic Configuration getFlinkConfiguration()
AbstractFlinkYarnCluster
getFlinkConfiguration
in class AbstractFlinkYarnCluster
public InetSocketAddress getJobManagerAddress()
AbstractFlinkYarnCluster
getJobManagerAddress
in class AbstractFlinkYarnCluster
public String getWebInterfaceURL()
AbstractFlinkYarnCluster
getWebInterfaceURL
in class AbstractFlinkYarnCluster
public String getApplicationId()
AbstractFlinkYarnCluster
getApplicationId
in class AbstractFlinkYarnCluster
public boolean isDetached()
AbstractFlinkYarnCluster
isDetached
in class AbstractFlinkYarnCluster
public FlinkYarnClusterStatus getClusterStatus()
getClusterStatus
in class AbstractFlinkYarnCluster
public boolean hasFailed()
AbstractFlinkYarnCluster
hasFailed
in class AbstractFlinkYarnCluster
public String getDiagnostics()
getDiagnostics
in class AbstractFlinkYarnCluster
public List<String> getNewMessages()
AbstractFlinkYarnCluster
getNewMessages
in class AbstractFlinkYarnCluster
public void shutdown(boolean failApplication)
shutdown
in class AbstractFlinkYarnCluster
failApplication
- whether we should fail the YARN application (in case of errors in Flink)public boolean hasBeenStopped()
AbstractFlinkYarnCluster
hasBeenStopped
in class AbstractFlinkYarnCluster
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.