public class MiniClusterClient extends Object implements ClusterClient<MiniClusterClient.MiniClusterId>
MiniCluster.| Modifier and Type | Class and Description |
|---|---|
static class |
MiniClusterClient.MiniClusterId
The type of the Cluster ID for the local
MiniCluster. |
| Constructor and Description |
|---|
MiniClusterClient(org.apache.flink.configuration.Configuration configuration,
org.apache.flink.runtime.minicluster.MiniCluster miniCluster) |
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<org.apache.flink.runtime.messages.Acknowledge> |
cancel(org.apache.flink.api.common.JobID jobId)
Cancels a job identified by the job id.
|
CompletableFuture<String> |
cancelWithSavepoint(org.apache.flink.api.common.JobID jobId,
String savepointDirectory,
org.apache.flink.core.execution.SavepointFormatType formatType)
Cancels a job identified by the job id and triggers a savepoint.
|
void |
close() |
CompletableFuture<org.apache.flink.runtime.messages.Acknowledge> |
disposeSavepoint(String savepointPath)
Dispose the savepoint under the given path.
|
CompletableFuture<Map<String,Object>> |
getAccumulators(org.apache.flink.api.common.JobID jobID,
ClassLoader loader)
Requests and returns the accumulators for the given job identifier.
|
MiniClusterClient.MiniClusterId |
getClusterId()
Returns the cluster id identifying the cluster to which the client is connected.
|
org.apache.flink.configuration.Configuration |
getFlinkConfiguration()
Return the Flink configuration object.
|
CompletableFuture<org.apache.flink.api.common.JobStatus> |
getJobStatus(org.apache.flink.api.common.JobID jobId)
Requests the
JobStatus of the job with the given JobID. |
String |
getWebInterfaceURL()
Returns an URL (as a string) to the cluster web interface.
|
CompletableFuture<Void> |
invalidateClusterDataset(org.apache.flink.util.AbstractID clusterDatasetId)
Invalidate the cached intermediate dataset with the given id.
|
CompletableFuture<Set<org.apache.flink.util.AbstractID>> |
listCompletedClusterDatasetIds()
Return a set of ids of the completed cluster datasets.
|
CompletableFuture<Collection<org.apache.flink.runtime.client.JobStatusMessage>> |
listJobs()
Lists the currently running and finished jobs on the cluster.
|
CompletableFuture<Void> |
reportHeartbeat(org.apache.flink.api.common.JobID jobId,
long expiredTimestamp)
The client reports the heartbeat to the dispatcher for aliveness.
|
CompletableFuture<org.apache.flink.runtime.jobmaster.JobResult> |
requestJobResult(org.apache.flink.api.common.JobID jobId)
Request the
JobResult for the given JobID. |
CompletableFuture<org.apache.flink.runtime.operators.coordination.CoordinationResponse> |
sendCoordinationRequest(org.apache.flink.api.common.JobID jobId,
org.apache.flink.runtime.jobgraph.OperatorID operatorId,
org.apache.flink.runtime.operators.coordination.CoordinationRequest request)
Sends out a request to a specified coordinator and return the response.
|
void |
shutDownCluster()
Shut down the cluster that this client communicate with.
|
CompletableFuture<String> |
stopWithSavepoint(org.apache.flink.api.common.JobID jobId,
boolean advanceToEndOfEventTime,
String savepointDirectory,
org.apache.flink.core.execution.SavepointFormatType formatType)
Stops a program on Flink cluster whose job-manager is configured in this client's
configuration.
|
CompletableFuture<org.apache.flink.api.common.JobID> |
submitJob(org.apache.flink.runtime.jobgraph.JobGraph jobGraph)
Submit the given
JobGraph to the cluster. |
CompletableFuture<String> |
triggerSavepoint(org.apache.flink.api.common.JobID jobId,
String savepointDirectory,
org.apache.flink.core.execution.SavepointFormatType formatType)
Triggers a savepoint for the job identified by the job id.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAccumulatorspublic org.apache.flink.configuration.Configuration getFlinkConfiguration()
ClusterClientgetFlinkConfiguration in interface ClusterClient<MiniClusterClient.MiniClusterId>public CompletableFuture<org.apache.flink.api.common.JobID> submitJob(@Nonnull org.apache.flink.runtime.jobgraph.JobGraph jobGraph)
ClusterClientJobGraph to the cluster.submitJob in interface ClusterClient<MiniClusterClient.MiniClusterId>jobGraph - to submitJobID of the submitted jobpublic CompletableFuture<org.apache.flink.runtime.jobmaster.JobResult> requestJobResult(@Nonnull org.apache.flink.api.common.JobID jobId)
ClusterClientJobResult for the given JobID.requestJobResult in interface ClusterClient<MiniClusterClient.MiniClusterId>jobId - for which to request the JobResultJobResultpublic CompletableFuture<org.apache.flink.runtime.messages.Acknowledge> cancel(org.apache.flink.api.common.JobID jobId)
ClusterClientcancel in interface ClusterClient<MiniClusterClient.MiniClusterId>jobId - the job idpublic CompletableFuture<String> cancelWithSavepoint(org.apache.flink.api.common.JobID jobId, @Nullable String savepointDirectory, org.apache.flink.core.execution.SavepointFormatType formatType)
ClusterClientcancelWithSavepoint in interface ClusterClient<MiniClusterClient.MiniClusterId>jobId - the job idsavepointDirectory - directory the savepoint should be written toformatType - a binary format of the savepointpublic CompletableFuture<String> stopWithSavepoint(org.apache.flink.api.common.JobID jobId, boolean advanceToEndOfEventTime, @Nullable String savepointDirectory, org.apache.flink.core.execution.SavepointFormatType formatType)
ClusterClientstopWithSavepoint in interface ClusterClient<MiniClusterClient.MiniClusterId>jobId - the job ID of the streaming program to stopadvanceToEndOfEventTime - flag indicating if the source should inject a MAX_WATERMARK in the pipelinesavepointDirectory - directory the savepoint should be written toformatType - a binary format of the savepointCompletableFuture containing the path where the savepoint is locatedpublic CompletableFuture<String> triggerSavepoint(org.apache.flink.api.common.JobID jobId, @Nullable String savepointDirectory, org.apache.flink.core.execution.SavepointFormatType formatType)
ClusterClientCheckpointingOptions.SAVEPOINT_DIRECTORY if it is null.triggerSavepoint in interface ClusterClient<MiniClusterClient.MiniClusterId>jobId - job idsavepointDirectory - directory the savepoint should be written toformatType - a binary format of the savepointpublic CompletableFuture<org.apache.flink.runtime.messages.Acknowledge> disposeSavepoint(String savepointPath)
ClusterClientdisposeSavepoint in interface ClusterClient<MiniClusterClient.MiniClusterId>savepointPath - path to the savepoint to be disposedpublic CompletableFuture<Collection<org.apache.flink.runtime.client.JobStatusMessage>> listJobs()
ClusterClientlistJobs in interface ClusterClient<MiniClusterClient.MiniClusterId>public CompletableFuture<Map<String,Object>> getAccumulators(org.apache.flink.api.common.JobID jobID, ClassLoader loader)
ClusterClientgetAccumulators in interface ClusterClient<MiniClusterClient.MiniClusterId>jobID - The job identifier of a job.loader - The class loader for deserializing the accumulator results.public CompletableFuture<org.apache.flink.api.common.JobStatus> getJobStatus(org.apache.flink.api.common.JobID jobId)
ClusterClientJobStatus of the job with the given JobID.getJobStatus in interface ClusterClient<MiniClusterClient.MiniClusterId>public void close()
close in interface AutoCloseableclose in interface ClusterClient<MiniClusterClient.MiniClusterId>public MiniClusterClient.MiniClusterId getClusterId()
ClusterClientgetClusterId in interface ClusterClient<MiniClusterClient.MiniClusterId>public void shutDownCluster()
ClusterClientshutDownCluster in interface ClusterClient<MiniClusterClient.MiniClusterId>public String getWebInterfaceURL()
ClusterClientgetWebInterfaceURL in interface ClusterClient<MiniClusterClient.MiniClusterId>public CompletableFuture<org.apache.flink.runtime.operators.coordination.CoordinationResponse> sendCoordinationRequest(org.apache.flink.api.common.JobID jobId, org.apache.flink.runtime.jobgraph.OperatorID operatorId, org.apache.flink.runtime.operators.coordination.CoordinationRequest request)
ClusterClientsendCoordinationRequest in interface ClusterClient<MiniClusterClient.MiniClusterId>jobId - specifies the job which the coordinator belongs tooperatorId - specifies which coordinator to receive the requestrequest - the request to sendpublic CompletableFuture<Set<org.apache.flink.util.AbstractID>> listCompletedClusterDatasetIds()
ClusterClientlistCompletedClusterDatasetIds in interface ClusterClient<MiniClusterClient.MiniClusterId>public CompletableFuture<Void> invalidateClusterDataset(org.apache.flink.util.AbstractID clusterDatasetId)
ClusterClientinvalidateClusterDataset in interface ClusterClient<MiniClusterClient.MiniClusterId>clusterDatasetId - id of the cluster dataset to be invalidated.public CompletableFuture<Void> reportHeartbeat(org.apache.flink.api.common.JobID jobId, long expiredTimestamp)
ClusterClientreportHeartbeat in interface ClusterClient<MiniClusterClient.MiniClusterId>jobId - The jobId for the client and the job.Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.