Class StandaloneClusterDescriptor
- java.lang.Object
-
- org.apache.flink.client.deployment.StandaloneClusterDescriptor
-
- All Implemented Interfaces:
AutoCloseable,ClusterDescriptor<StandaloneClusterId>
public class StandaloneClusterDescriptor extends Object implements ClusterDescriptor<StandaloneClusterId>
A deployment descriptor for an existing cluster.
-
-
Constructor Summary
Constructors Constructor Description StandaloneClusterDescriptor(org.apache.flink.configuration.Configuration config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()ClusterClientProvider<StandaloneClusterId>deployApplicationCluster(ClusterSpecification clusterSpecification, ApplicationConfiguration applicationConfiguration)Triggers deployment of an application cluster.ClusterClientProvider<StandaloneClusterId>deployJobCluster(ClusterSpecification clusterSpecification, org.apache.flink.runtime.jobgraph.JobGraph jobGraph, boolean detached)Deploys a per-job cluster with the given job on the cluster.ClusterClientProvider<StandaloneClusterId>deploySessionCluster(ClusterSpecification clusterSpecification)Triggers deployment of a cluster.StringgetClusterDescription()Returns a String containing details about the cluster (NodeManagers, available memory, ...).voidkillCluster(StandaloneClusterId clusterId)Terminates the cluster with the given cluster id.ClusterClientProvider<StandaloneClusterId>retrieve(StandaloneClusterId standaloneClusterId)Retrieves an existing Flink Cluster.
-
-
-
Method Detail
-
getClusterDescription
public String getClusterDescription()
Description copied from interface:ClusterDescriptorReturns a String containing details about the cluster (NodeManagers, available memory, ...).- Specified by:
getClusterDescriptionin interfaceClusterDescriptor<StandaloneClusterId>
-
retrieve
public ClusterClientProvider<StandaloneClusterId> retrieve(StandaloneClusterId standaloneClusterId) throws ClusterRetrieveException
Description copied from interface:ClusterDescriptorRetrieves an existing Flink Cluster.- Specified by:
retrievein interfaceClusterDescriptor<StandaloneClusterId>- Parameters:
standaloneClusterId- The unique identifier of the running cluster- Returns:
- Client for the cluster
- Throws:
ClusterRetrieveException- if the cluster client could not be retrieved
-
deploySessionCluster
public ClusterClientProvider<StandaloneClusterId> deploySessionCluster(ClusterSpecification clusterSpecification)
Description copied from interface:ClusterDescriptorTriggers deployment of a cluster.- Specified by:
deploySessionClusterin interfaceClusterDescriptor<StandaloneClusterId>- Parameters:
clusterSpecification- Cluster specification defining the cluster to deploy- Returns:
- Client for the cluster
-
deployApplicationCluster
public ClusterClientProvider<StandaloneClusterId> deployApplicationCluster(ClusterSpecification clusterSpecification, ApplicationConfiguration applicationConfiguration)
Description copied from interface:ClusterDescriptorTriggers deployment of an application cluster. This corresponds to a cluster dedicated to the execution of a predefined application. The cluster will be created on application submission and torn down upon application termination. In addition, themain()of the application's user code will be executed on the cluster, rather than the client.- Specified by:
deployApplicationClusterin interfaceClusterDescriptor<StandaloneClusterId>- Parameters:
clusterSpecification- Cluster specification defining the cluster to deployapplicationConfiguration- Application-specific configuration parameters- Returns:
- Client for the cluster
-
deployJobCluster
public ClusterClientProvider<StandaloneClusterId> deployJobCluster(ClusterSpecification clusterSpecification, org.apache.flink.runtime.jobgraph.JobGraph jobGraph, boolean detached)
Description copied from interface:ClusterDescriptorDeploys a per-job cluster with the given job on the cluster.- Specified by:
deployJobClusterin interfaceClusterDescriptor<StandaloneClusterId>- Parameters:
clusterSpecification- Initial cluster specification with which the Flink cluster is launchedjobGraph- JobGraph with which the job cluster is starteddetached- true if the cluster should be stopped after the job completion without serving the result, otherwise false- Returns:
- Cluster client to talk to the Flink cluster
-
killCluster
public void killCluster(StandaloneClusterId clusterId) throws org.apache.flink.util.FlinkException
Description copied from interface:ClusterDescriptorTerminates the cluster with the given cluster id.- Specified by:
killClusterin interfaceClusterDescriptor<StandaloneClusterId>- Parameters:
clusterId- identifying the cluster to shut down- Throws:
org.apache.flink.util.FlinkException- if the cluster could not be terminated
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceClusterDescriptor<StandaloneClusterId>
-
-