dawidwys commented on a change in pull request #18482:
URL: https://github.com/apache/flink/pull/18482#discussion_r793581546



##########
File path: 
flink-clients/src/main/java/org/apache/flink/client/cli/CancelOptions.java
##########
@@ -33,11 +37,21 @@
     /** Optional target directory for the savepoint. Overwrites cluster 
default. */
     private final String targetDirectory;
 
+    private final SavepointFormatType formatType;
+
     public CancelOptions(CommandLine line) {
         super(line);
         this.args = line.getArgs();
         this.withSavepoint = 
line.hasOption(CANCEL_WITH_SAVEPOINT_OPTION.getOpt());
         this.targetDirectory = 
line.getOptionValue(CANCEL_WITH_SAVEPOINT_OPTION.getOpt());
+        if (line.hasOption(SAVEPOINT_FORMAT_OPTION)) {
+            formatType =
+                    ConfigurationUtils.convertValue(
+                            line.getOptionValue(SAVEPOINT_FORMAT_OPTION),
+                            SavepointFormatType.class);
+        } else {
+            formatType = SavepointFormatType.DEFAULT;

Review comment:
       Which ifs? We are not converting from a string here, but from a 
`CommandLine`. For that reason I don't think `SavepointFormatType` is the 
correct place, but I'll give it a second thought where in the cli package we 
could put that code.




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to