zentol commented on code in PR #21012:
URL: https://github.com/apache/flink/pull/21012#discussion_r995537283


##########
flink-runtime-web/src/test/java/org/apache/flink/runtime/webmonitor/handlers/JarHandlerParameterTest.java:
##########
@@ -211,6 +218,37 @@ void testProvideJobId() throws Exception {
         assertThat(jobGraph.get().getJobID()).isEqualTo(jobId);
     }
 
+    @Test
+    void testProvideFlinkConfig() throws Exception {
+
+        REQB jarRequestBodyWithFlinkConfig = 
getJarRequestBodyWithFlinkConfig(FLINK_CONFIGURATION);
+        HandlerRequest<REQB> request =
+                createRequest(
+                        getJarRequestBodyWithFlinkConfig(FLINK_CONFIGURATION),
+                        getUnresolvedJarMessageParameters(),
+                        getUnresolvedJarMessageParameters(),
+                        jarWithManifest);
+
+        handleRequest(request);
+
+        Optional<JobGraph> jobGraph = getLastSubmittedJobGraphAndReset();
+
+        assertThat(jobGraph.isPresent()).isTrue();

Review Comment:
   This isn't the case of the JarPlanHandler.



##########
flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/JarRunHandler.java:
##########
@@ -92,7 +93,17 @@ public CompletableFuture<JarRunResponseBody> handleRequest(
             @Nonnull final DispatcherGateway gateway)
             throws RestHandlerException {
 
-        final Configuration effectiveConfiguration = new 
Configuration(configuration);
+        Map<String, String> requestJobFlinkConfig =
+                HandlerRequestUtils.fromRequestBodyOrQueryParameter(
+                        (request.getRequestBody()).getFlinkConfiguration(),
+                        () -> null,
+                        null,
+                        this.log);

Review Comment:
   ```suggestion
           Map<String, String> requestJobFlinkConfig = 
request.getRequestBody().getFlinkConfiguration();
   ```
   Since there's no query parameter it doesn't make sense to call this method.



##########
flink-runtime-web/src/test/java/org/apache/flink/runtime/webmonitor/handlers/JarHandlerParameterTest.java:
##########
@@ -211,6 +218,37 @@ void testProvideJobId() throws Exception {
         assertThat(jobGraph.get().getJobID()).isEqualTo(jobId);
     }
 
+    @Test
+    void testProvideFlinkConfig() throws Exception {
+
+        REQB jarRequestBodyWithFlinkConfig = 
getJarRequestBodyWithFlinkConfig(FLINK_CONFIGURATION);
+        HandlerRequest<REQB> request =
+                createRequest(
+                        getJarRequestBodyWithFlinkConfig(FLINK_CONFIGURATION),
+                        getUnresolvedJarMessageParameters(),
+                        getUnresolvedJarMessageParameters(),
+                        jarWithManifest);
+
+        handleRequest(request);
+
+        Optional<JobGraph> jobGraph = getLastSubmittedJobGraphAndReset();
+
+        assertThat(jobGraph.isPresent()).isTrue();
+        JobGraph graph = jobGraph.get();
+
+        assertThat(getExecutionConfig(graph).getParallelism())
+                .isNotEqualTo(
+                        Integer.valueOf(
+                                
FLINK_CONFIGURATION.get(CoreOptions.DEFAULT_PARALLELISM.key())));
+        if (jarRequestBodyWithFlinkConfig instanceof JarRunRequestBody) {

Review Comment:
   Why is this specific to the jar run handler?



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to