You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/04/21 07:48:08 UTC

[GitHub] [flink] aljoscha commented on a change in pull request #10904: [FLINK-15669] [sql client] fix SQL client can't cancel flink job

aljoscha commented on a change in pull request #10904:
URL: https://github.com/apache/flink/pull/10904#discussion_r411951194



##########
File path: flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/local/result/CollectStreamResult.java
##########
@@ -86,18 +86,17 @@ public CollectStreamResult(
 	}
 
 	@Override
-	public void startRetrieval(ProgramDeployer deployer) {
+	public void startRetrieval(JobClient jobClient) {
 		// start listener thread
 		retrievalThread.start();
 
-		jobExecutionResultFuture = deployer
-				.deploy()
-				.thenCompose(jobClient -> jobClient.getJobExecutionResult(classLoader))
+		jobExecutionResultFuture = CompletableFuture.completedFuture(jobClient)

Review comment:
       this should just be `jobClient.getJobExecutionResult(classLoader)`, no need to wrap the jobClient in a future and then compose sth to it.

##########
File path: flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/local/result/MaterializedCollectBatchResult.java
##########
@@ -76,10 +77,9 @@ public boolean isMaterialized() {
 	}
 
 	@Override
-	public void startRetrieval(ProgramDeployer deployer) {
-		deployer
-				.deploy()
-				.thenCompose(jobClient -> jobClient.getJobExecutionResult(classLoader))
+	public void startRetrieval(JobClient jobClient) {
+		CompletableFuture.completedFuture(jobClient)
+				.thenCompose(client -> client.getJobExecutionResult(classLoader))

Review comment:
       this should just be jobClient.getJobExecutionResult(classLoader), no need to wrap the jobClient in a future and then compose sth to it.




----------------------------------------------------------------
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:
users@infra.apache.org