public class RestClusterClient<T> extends Object implements ClusterClient<T>
ClusterClient implementation that communicates via HTTP REST requests.| 构造器和说明 |
|---|
RestClusterClient(org.apache.flink.configuration.Configuration config,
T clusterId) |
RestClusterClient(org.apache.flink.configuration.Configuration config,
T clusterId,
org.apache.flink.runtime.highavailability.ClientHighAvailabilityServices clientHAServices) |
| 限定符和类型 | 方法和说明 |
|---|---|
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)
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.
|
T |
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.runtime.rest.messages.job.JobDetailsInfo> |
getJobDetails(org.apache.flink.api.common.JobID jobId)
Requests the job details.
|
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<Collection<org.apache.flink.runtime.client.JobStatusMessage>> |
listJobs()
Lists the currently running and finished jobs on the cluster.
|
CompletableFuture<org.apache.flink.runtime.jobmaster.JobResult> |
requestJobResult(org.apache.flink.api.common.JobID jobId)
Requests the
JobResult for the given JobID. |
<M extends org.apache.flink.runtime.rest.messages.MessageHeaders<R,P,U>,U extends org.apache.flink.runtime.rest.messages.MessageParameters,R extends org.apache.flink.runtime.rest.messages.RequestBody,P extends org.apache.flink.runtime.rest.messages.ResponseBody> |
sendRequest(M messageHeaders,
U messageParameters,
R request) |
void |
shutDownCluster()
Shut down the cluster that this client communicate with.
|
CompletableFuture<String> |
stopWithSavepoint(org.apache.flink.api.common.JobID jobId,
boolean advanceToEndOfTime,
String savepointDirectory)
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)
Triggers a savepoint for the job identified by the job id.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAccumulatorspublic RestClusterClient(org.apache.flink.configuration.Configuration config,
T clusterId)
throws Exception
Exceptionpublic org.apache.flink.configuration.Configuration getFlinkConfiguration()
ClusterClientgetFlinkConfiguration 在接口中 ClusterClient<T>public void close()
close 在接口中 AutoCloseableclose 在接口中 ClusterClient<T>public CompletableFuture<org.apache.flink.runtime.rest.messages.job.JobDetailsInfo> getJobDetails(org.apache.flink.api.common.JobID jobId)
jobId - The job idpublic CompletableFuture<org.apache.flink.api.common.JobStatus> getJobStatus(org.apache.flink.api.common.JobID jobId)
ClusterClientJobStatus of the job with the given JobID.getJobStatus 在接口中 ClusterClient<T>public CompletableFuture<org.apache.flink.runtime.jobmaster.JobResult> requestJobResult(@Nonnull org.apache.flink.api.common.JobID jobId)
JobResult for the given JobID. The method retries multiple
times to poll the JobResult before giving up.requestJobResult 在接口中 ClusterClient<T>jobId - specifying the job for which to retrieve the JobResultJobResult once the job has completed or
with a failure if the JobResult could not be retrieved.public CompletableFuture<org.apache.flink.api.common.JobID> submitJob(@Nonnull org.apache.flink.runtime.jobgraph.JobGraph jobGraph)
ClusterClientJobGraph to the cluster.submitJob 在接口中 ClusterClient<T>jobGraph - to submitJobID of the submitted jobpublic CompletableFuture<org.apache.flink.runtime.messages.Acknowledge> cancel(org.apache.flink.api.common.JobID jobID)
ClusterClientcancel 在接口中 ClusterClient<T>jobID - the job idpublic CompletableFuture<String> stopWithSavepoint(org.apache.flink.api.common.JobID jobId, boolean advanceToEndOfTime, @Nullable String savepointDirectory)
ClusterClientstopWithSavepoint 在接口中 ClusterClient<T>jobId - the job ID of the streaming program to stopadvanceToEndOfTime - flag indicating if the source should inject a MAX_WATERMARK in the pipelinesavepointDirectory - directory the savepoint should be written toCompletableFuture containing the path where the savepoint is locatedpublic CompletableFuture<String> cancelWithSavepoint(org.apache.flink.api.common.JobID jobId, @Nullable String savepointDirectory)
ClusterClientcancelWithSavepoint 在接口中 ClusterClient<T>jobId - the job idsavepointDirectory - directory the savepoint should be written topublic CompletableFuture<String> triggerSavepoint(org.apache.flink.api.common.JobID jobId, @Nullable String savepointDirectory)
ClusterClientCheckpointingOptions.SAVEPOINT_DIRECTORY if it is null.triggerSavepoint 在接口中 ClusterClient<T>jobId - job idsavepointDirectory - directory the savepoint should be written topublic CompletableFuture<Map<String,Object>> getAccumulators(org.apache.flink.api.common.JobID jobID, ClassLoader loader)
ClusterClientgetAccumulators 在接口中 ClusterClient<T>jobID - The job identifier of a job.loader - The class loader for deserializing the accumulator results.public CompletableFuture<Collection<org.apache.flink.runtime.client.JobStatusMessage>> listJobs()
ClusterClientlistJobs 在接口中 ClusterClient<T>public T getClusterId()
ClusterClientgetClusterId 在接口中 ClusterClient<T>public CompletableFuture<org.apache.flink.runtime.messages.Acknowledge> disposeSavepoint(String savepointPath)
ClusterClientdisposeSavepoint 在接口中 ClusterClient<T>savepointPath - path to the savepoint to be disposedpublic void shutDownCluster()
ClusterClientshutDownCluster 在接口中 ClusterClient<T>public String getWebInterfaceURL()
ClusterClientgetWebInterfaceURL 在接口中 ClusterClient<T>@VisibleForTesting public <M extends org.apache.flink.runtime.rest.messages.MessageHeaders<R,P,U>,U extends org.apache.flink.runtime.rest.messages.MessageParameters,R extends org.apache.flink.runtime.rest.messages.RequestBody,P extends org.apache.flink.runtime.rest.messages.ResponseBody> CompletableFuture<P> sendRequest(M messageHeaders, U messageParameters, R request)
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.