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

    https://github.com/apache/flink/pull/6330#discussion_r203365784
  
    --- Diff: 
flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/JarRunHandler.java
 ---
    @@ -138,12 +154,22 @@ public JarRunHandler(
                        });
        }
     
    -   private static SavepointRestoreSettings getSavepointRestoreSettings(
    -                   final @Nonnull HandlerRequest<EmptyRequestBody, 
JarRunMessageParameters> request)
    +   private SavepointRestoreSettings getSavepointRestoreSettings(
    +                   final @Nonnull HandlerRequest<JarRunRequestBody, 
JarRunMessageParameters> request)
                                throws RestHandlerException {
     
    -           final boolean allowNonRestoredState = 
getQueryParameter(request, AllowNonRestoredStateQueryParameter.class, false);
    -           final String savepointPath = getQueryParameter(request, 
SavepointPathQueryParameter.class);
    +           final JarRunRequestBody requestBody = request.getRequestBody();
    +
    +           final boolean allowNonRestoredState = 
fromRequestBodyOrQueryParameter(
    +                   requestBody.getAllowNonRestoredState(),
    +                   () -> getQueryParameter(request, 
AllowNonRestoredStateQueryParameter.class),
    +                   false,
    +                   log);
    +           final String savepointPath = fromRequestBodyOrQueryParameter(
    --- End diff --
    
    True, making the specification of the default value explicit will better 
guard against this. In the other case, the user would have to know the 
difference between these methods and which to apply to primitive and 
non-primitive values. Alright, then it's good to go from my side.


---

Reply via email to