kl0u commented on a change in pull request #10069: [FLINK-14593][client] Port
ClusterClient to asynchronous interface version
URL: https://github.com/apache/flink/pull/10069#discussion_r343015510
##########
File path:
flink-clients/src/main/java/org/apache/flink/client/program/ClusterClient.java
##########
@@ -132,47 +130,46 @@ public void close() throws Exception {
* @param loader The class loader for deserializing the accumulator
results.
* @return A Map containing the accumulator's name and its value.
*/
- public abstract Map<String, OptionalFailure<Object>>
getAccumulators(JobID jobID, ClassLoader loader) throws Exception;
-
- //
------------------------------------------------------------------------
- // Abstract methods to be implemented by the cluster specific Client
- //
------------------------------------------------------------------------
-
- /**
- * Returns an URL (as a string) to the JobManager web interface.
- */
- public abstract String getWebInterfaceURL();
+ CompletableFuture<Map<String, OptionalFailure<Object>>>
getAccumulators(JobID jobID, ClassLoader loader);
/**
- * Returns the cluster id identifying the cluster to which the client
is connected.
+ * Cancels a job identified by the job id.
*
- * @return cluster id of the connected cluster
+ * @param jobId the job id
*/
- public abstract T getClusterId();
+ CompletableFuture<Acknowledge> cancel(JobID jobId);
/**
- * Return the Flink configuration object.
- * @return The Flink configuration object
+ * Cancels a job identified by the job id and triggers a savepoint.
+ *
+ * @param jobId the job id
+ * @param savepointDirectory directory the savepoint should be written
to
+ * @return future of path where the savepoint is located
*/
- public abstract Configuration getFlinkConfiguration();
+ CompletableFuture<String> cancelWithSavepoint(JobID jobId, @Nullable
String savepointDirectory);
/**
- * Submit the given {@link JobGraph} to the cluster.
+ * Stops a program on Flink cluster whose job-manager is configured in
this client's configuration.
+ * Stopping works only for streaming programs. Be aware, that the
program might continue to run for
+ * a while after sending the stop command, because after sources
stopped to emit data all operators
+ * need to finish processing.
*
- * @param jobGraph to submit
- * @return Future which is completed with the {@link
JobSubmissionResult}
+ * @param jobId the job ID of the streaming program to stop
+ * @param advanceToEndOfEventTime flag indicating if the source should
inject a {@code MAX_WATERMARK} in the pipeline
+ * @param savepointDirectory directory the savepoint should be written
to
+ * @return a {@link CompletableFuture} containing the path where the
savepoint is located
*/
- public abstract CompletableFuture<JobSubmissionResult>
submitJob(@Nonnull JobGraph jobGraph);
+ CompletableFuture<String> stopWithSavepoint(final JobID jobId, final
boolean advanceToEndOfEventTime, @Nullable final String savepointDirectory);
/**
- * Request the {@link JobResult} for the given {@link JobID}.
+ * Triggers a savepoint for the job identified by the job id. The
savepoint will be written to the given savepoint
+ * directory, or {@link
org.apache.flink.configuration.CheckpointingOptions#SAVEPOINT_DIRECTORY} if it
is null.
*
- * @param jobId for which to request the {@link JobResult}
- * @return Future which is completed with the {@link JobResult}
+ * @param jobId job id
+ * @param savepointDirectory directory the savepoint should be written
to
+ * @return path future where the savepoint is located
+ * @throws FlinkException if no connection to the cluster could be
established
*/
- public abstract CompletableFuture<JobResult> requestJobResult(@Nonnull
JobID jobId);
-
- public void shutDownCluster() {
- throw new UnsupportedOperationException("The " +
getClass().getSimpleName() + " does not support shutDownCluster.");
- }
+ CompletableFuture<String> triggerSavepoint(JobID jobId, @Nullable
String savepointDirectory) throws FlinkException;
+ //endregion
Review comment:
Please remove this comment.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services