akalash commented on a change in pull request #18482:
URL: https://github.com/apache/flink/pull/18482#discussion_r793828154
##########
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 think you can leave it as is now. I still feel that it is not great
since I see the pretty classic pattern `deserialize-if-not-null-or-default` but
I am not ready to say what will be better since we already have several layers
String->ConfigOption->String->Object(or something similar) and I don't want to
make it more difficult.
--
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]