yanghua commented on a change in pull request #9013: [FLINK-13136] Fix 
documentation error about stopping job with restful api
URL: https://github.com/apache/flink/pull/9013#discussion_r323628359
 
 

 ##########
 File path: 
flink-clients/src/main/java/org/apache/flink/client/program/rest/RestClusterClient.java
 ##########
 @@ -375,7 +374,7 @@ public JobSubmissionResult submitJob(JobGraph jobGraph, 
ClassLoader classLoader)
        public void cancel(JobID jobID) throws Exception {
                JobCancellationMessageParameters params = new 
JobCancellationMessageParameters();
                params.jobPathParameter.resolve(jobID);
-               
params.terminationModeQueryParameter.resolve(Collections.singletonList(TerminationModeQueryParameter.TerminationMode.CANCEL));
+               
params.terminationModeQueryParameter.resolve(Collections.singletonList("CANCEL"));
 
 Review comment:
   Originally, I also think enum is a good choice than string. However, when I 
removed `TerminationMode.STOP`, there is only one enum value `CANCEL `. I 
suspect that multiple modes may be the reason why we define `TerminationMode` 
and I also saw the deprecation annotation, so I replaced enum with String 
value. Whatever, I am not against keeping `TerminationMode`. Will refactor the 
change soon.

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


With regards,
Apache Git Services

Reply via email to