Interface ClusterDescriptor<T>
-
- Type Parameters:
T
- Type of the cluster id
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
KubernetesClusterDescriptor
,StandaloneClusterDescriptor
,YarnClusterDescriptor
public interface ClusterDescriptor<T> extends AutoCloseable
A descriptor to deploy a cluster (e.g. Yarn) and return a Client for Cluster communication.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
close()
ClusterClientProvider<T>
deployApplicationCluster(ClusterSpecification clusterSpecification, ApplicationConfiguration applicationConfiguration)
Triggers deployment of an application cluster.ClusterClientProvider<T>
deployJobCluster(ClusterSpecification clusterSpecification, JobGraph jobGraph, boolean detached)
Deprecated.Per-job mode has been deprecated in Flink 1.15 and will be removed in the future.ClusterClientProvider<T>
deploySessionCluster(ClusterSpecification clusterSpecification)
Triggers deployment of a cluster.String
getClusterDescription()
Returns a String containing details about the cluster (NodeManagers, available memory, ...).void
killCluster(T clusterId)
Terminates the cluster with the given cluster id.ClusterClientProvider<T>
retrieve(T clusterId)
Retrieves an existing Flink Cluster.
-
-
-
Method Detail
-
getClusterDescription
String getClusterDescription()
Returns a String containing details about the cluster (NodeManagers, available memory, ...).
-
retrieve
ClusterClientProvider<T> retrieve(T clusterId) throws ClusterRetrieveException
Retrieves an existing Flink Cluster.- Parameters:
clusterId
- The unique identifier of the running cluster- Returns:
- Client for the cluster
- Throws:
ClusterRetrieveException
- if the cluster client could not be retrieved
-
deploySessionCluster
ClusterClientProvider<T> deploySessionCluster(ClusterSpecification clusterSpecification) throws ClusterDeploymentException
Triggers deployment of a cluster.- Parameters:
clusterSpecification
- Cluster specification defining the cluster to deploy- Returns:
- Client for the cluster
- Throws:
ClusterDeploymentException
- if the cluster could not be deployed
-
deployApplicationCluster
ClusterClientProvider<T> deployApplicationCluster(ClusterSpecification clusterSpecification, ApplicationConfiguration applicationConfiguration) throws ClusterDeploymentException
Triggers 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.- Parameters:
clusterSpecification
- Cluster specification defining the cluster to deployapplicationConfiguration
- Application-specific configuration parameters- Returns:
- Client for the cluster
- Throws:
ClusterDeploymentException
- if the cluster could not be deployed
-
deployJobCluster
@Deprecated ClusterClientProvider<T> deployJobCluster(ClusterSpecification clusterSpecification, JobGraph jobGraph, boolean detached) throws ClusterDeploymentException
Deprecated.Per-job mode has been deprecated in Flink 1.15 and will be removed in the future. Please use application mode instead.Deploys a per-job cluster with the given job on the cluster.- 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
- Throws:
ClusterDeploymentException
- if the cluster could not be deployed
-
killCluster
void killCluster(T clusterId) throws FlinkException
Terminates the cluster with the given cluster id.- Parameters:
clusterId
- identifying the cluster to shut down- Throws:
FlinkException
- if the cluster could not be terminated
-
close
void close()
- Specified by:
close
in interfaceAutoCloseable
-
-