Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5219#discussion_r160697769
  
    --- Diff: 
flink-clients/src/main/java/org/apache/flink/client/CliFrontend.java ---
    @@ -659,128 +655,107 @@ protected int savepoint(String[] args) {
                        return 0;
                }
     
    -           if (options.isDispose()) {
    -                   // Discard
    -                   return disposeSavepoint(options);
    -           } else {
    -                   // Trigger
    -                   String[] cleanedArgs = options.getArgs();
    -                   JobID jobId;
    +           CustomCommandLine<?> customCommandLine = 
getActiveCustomCommandLine(options.getCommandLine());
     
    -                   if (cleanedArgs.length >= 1) {
    -                           String jobIdString = cleanedArgs[0];
    -                           try {
    -                                   jobId = new 
JobID(StringUtils.hexStringToByte(jobIdString));
    -                           } catch (Exception e) {
    -                                   return handleArgException(new 
IllegalArgumentException(
    -                                                   "Error: The value for 
the Job ID is not a valid ID."));
    -                           }
    +           ClusterClient clusterClient = 
customCommandLine.retrieveCluster(options.getCommandLine(), config, 
configurationDirectory);
    +
    +           try {
    +                   if (options.isDispose()) {
    +                           // Discard
    +                           return disposeSavepoint(clusterClient, 
options.getSavepointPath());
                        } else {
    -                           return handleArgException(new 
IllegalArgumentException(
    +                           // Trigger
    +                           String[] cleanedArgs = options.getArgs();
    +                           JobID jobId;
    +
    +                           if (cleanedArgs.length >= 1) {
    +                                   String jobIdString = cleanedArgs[0];
    +                                   try {
    +                                           jobId = new 
JobID(StringUtils.hexStringToByte(jobIdString));
    --- End diff --
    
    Good catch. Will change it.


---

Reply via email to