Github user tillrohrmann commented on a diff in the pull request:
https://github.com/apache/flink/pull/6330#discussion_r203287485
--- 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 --
Maybe we could add a `fromRequestBodyOrQueryParameter` method which does
not take a default value as a convenience function. That way we would not have
all the calls where we pass `null`.
---