public class MiniClusterClient extends ClusterClient<org.apache.flink.client.program.MiniClusterClient.MiniClusterId> implements NewClusterClient
MiniCluster
.flinkConfig, highAvailabilityServices, lastJobExecutionResult, log, timeout
Constructor and Description |
---|
MiniClusterClient(Configuration configuration,
MiniCluster miniCluster) |
Modifier and Type | Method and Description |
---|---|
void |
cancel(JobID jobId)
Cancels a job identified by the job id.
|
String |
cancelWithSavepoint(JobID jobId,
String savepointDirectory)
Cancels a job identified by the job id and triggers a savepoint.
|
CompletableFuture<Acknowledge> |
disposeSavepoint(String savepointPath) |
Map<String,OptionalFailure<Object>> |
getAccumulators(JobID jobID,
ClassLoader loader)
Requests and returns the accumulators for the given job identifier.
|
org.apache.flink.client.program.MiniClusterClient.MiniClusterId |
getClusterId()
Returns the cluster id identifying the cluster to which the client is connected.
|
CompletableFuture<JobStatus> |
getJobStatus(JobID jobId)
|
String |
getWebInterfaceURL()
Returns an URL (as a string) to the JobManager web interface.
|
CompletableFuture<Collection<JobStatusMessage>> |
listJobs()
Lists the currently running and finished jobs on the cluster.
|
CompletableFuture<JobResult> |
requestJobResult(JobID jobId)
|
void |
shutdown()
Shuts down the client.
|
String |
stopWithSavepoint(JobID jobId,
boolean advanceToEndOfEventTime,
String savepointDirector)
Stops a program on Flink cluster whose job-manager is configured in this client's configuration.
|
CompletableFuture<JobSubmissionResult> |
submitJob(JobGraph jobGraph)
Submit the given
JobGraph to the cluster. |
JobSubmissionResult |
submitJob(JobGraph jobGraph,
ClassLoader classLoader)
Calls the subclasses' submitJob method.
|
CompletableFuture<String> |
triggerSavepoint(JobID jobId,
String savepointDirectory)
Triggers a savepoint for the job identified by the job id.
|
getAccumulators, getClusterConnectionInfo, getFlinkConfiguration, getJobGraph, getJobGraph, getOptimizedPlan, getOptimizedPlan, getOptimizedPlanAsJson, getPrintStatusDuringExecution, isDetached, run, run, run, run, run, setDetached, setPrintStatusDuringExecution, shutDownCluster
public MiniClusterClient(@Nonnull Configuration configuration, @Nonnull MiniCluster miniCluster)
public void shutdown() throws Exception
ClusterClient
shutdown
in class ClusterClient<org.apache.flink.client.program.MiniClusterClient.MiniClusterId>
Exception
public JobSubmissionResult submitJob(JobGraph jobGraph, ClassLoader classLoader) throws ProgramInvocationException
ClusterClient
submitJob
in class ClusterClient<org.apache.flink.client.program.MiniClusterClient.MiniClusterId>
jobGraph
- The JobGraph to be submittedProgramInvocationException
public CompletableFuture<JobSubmissionResult> submitJob(@Nonnull JobGraph jobGraph)
NewClusterClient
JobGraph
to the cluster.submitJob
in interface NewClusterClient
jobGraph
- to submitJobSubmissionResult
public CompletableFuture<JobResult> requestJobResult(@Nonnull JobID jobId)
NewClusterClient
requestJobResult
in interface NewClusterClient
jobId
- for which to request the JobResult
JobResult
public void cancel(JobID jobId) throws Exception
ClusterClient
cancel
in class ClusterClient<org.apache.flink.client.program.MiniClusterClient.MiniClusterId>
jobId
- the job idException
- In case an error occurred.public String cancelWithSavepoint(JobID jobId, @Nullable String savepointDirectory) throws Exception
ClusterClient
cancelWithSavepoint
in class ClusterClient<org.apache.flink.client.program.MiniClusterClient.MiniClusterId>
jobId
- the job idsavepointDirectory
- directory the savepoint should be written toException
- In case an error occurred.public String stopWithSavepoint(JobID jobId, boolean advanceToEndOfEventTime, @Nullable String savepointDirector) throws Exception
ClusterClient
stopWithSavepoint
in class ClusterClient<org.apache.flink.client.program.MiniClusterClient.MiniClusterId>
jobId
- the job ID of the streaming program to stopadvanceToEndOfEventTime
- flag indicating if the source should inject a MAX_WATERMARK
in the pipelinesavepointDirector
- directory the savepoint should be written toCompletableFuture
containing the path where the savepoint is locatedException
- If the job ID is invalid (ie, is unknown or refers to a batch job) or if sending the stop signal
failed. That might be due to an I/O problem, ie, the job-manager is unreachable.public CompletableFuture<String> triggerSavepoint(JobID jobId, @Nullable String savepointDirectory)
ClusterClient
CheckpointingOptions.SAVEPOINT_DIRECTORY
if it is null.triggerSavepoint
in class ClusterClient<org.apache.flink.client.program.MiniClusterClient.MiniClusterId>
jobId
- job idsavepointDirectory
- directory the savepoint should be written topublic CompletableFuture<Acknowledge> disposeSavepoint(String savepointPath)
disposeSavepoint
in class ClusterClient<org.apache.flink.client.program.MiniClusterClient.MiniClusterId>
public CompletableFuture<Collection<JobStatusMessage>> listJobs()
ClusterClient
listJobs
in class ClusterClient<org.apache.flink.client.program.MiniClusterClient.MiniClusterId>
public Map<String,OptionalFailure<Object>> getAccumulators(JobID jobID, ClassLoader loader) throws Exception
ClusterClient
getAccumulators
in class ClusterClient<org.apache.flink.client.program.MiniClusterClient.MiniClusterId>
jobID
- The job identifier of a job.loader
- The class loader for deserializing the accumulator results.Exception
public CompletableFuture<JobStatus> getJobStatus(JobID jobId)
ClusterClient
getJobStatus
in class ClusterClient<org.apache.flink.client.program.MiniClusterClient.MiniClusterId>
public org.apache.flink.client.program.MiniClusterClient.MiniClusterId getClusterId()
ClusterClient
getClusterId
in class ClusterClient<org.apache.flink.client.program.MiniClusterClient.MiniClusterId>
public String getWebInterfaceURL()
ClusterClient
getWebInterfaceURL
in class ClusterClient<org.apache.flink.client.program.MiniClusterClient.MiniClusterId>
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.