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



##########
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:
       I could do:
   ```
           this.formatType =
                   ConfigurationUtils.convertValue(
                           line.getOptionValue(
                                   SAVEPOINT_FORMAT_OPTION, 
SavepointFormatType.DEFAULT.toString()),
                           SavepointFormatType.class);
   ```
   
   Do you think that would be better? I would not like to extend the 
`convertValue` to handle default values or treat `null` specially. The default 
value for `ConfigOption(s)` is handled on a higher level.




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