zhuzhurk commented on code in PR #24091:
URL: https://github.com/apache/flink/pull/24091#discussion_r1461460681


##########
flink-runtime/src/main/java/org/apache/flink/runtime/util/bash/BashJavaUtils.java:
##########
@@ -175,6 +176,9 @@ public enum Command {
         GET_TM_RESOURCE_PARAMS,
 
         /** Get JVM parameters and dynamic configs of job manager resources. */
-        GET_JM_RESOURCE_PARAMS
+        GET_JM_RESOURCE_PARAMS,
+
+        /** Get and modify configuration from conf file and dynamic configs of 
the FLINK cluster. */
+        GET_FLINK_CONFIGURATION

Review Comment:
   It's weird to modify the configuration through a `get` action. Maybe 
`UPDATE_AND_GET_CONFIGURATION`?



##########
flink-runtime/src/test/java/org/apache/flink/runtime/entrypoint/YamlConfigurationParserFactoryTest.java:
##########
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.entrypoint;
+
+import org.apache.flink.api.java.tuple.Tuple3;
+import org.apache.flink.runtime.entrypoint.parser.CommandLineParser;
+
+import org.junit.jupiter.api.Test;
+
+import java.util.List;
+import java.util.Properties;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+
+/** Tests for the {@link YamlConfigurationParserFactory}. */
+class YamlConfigurationParserFactoryTest {
+
+    private static final CommandLineParser<YamlConfiguration> 
commandLineParser =
+            new CommandLineParser<>(new YamlConfigurationParserFactory());
+
+    @Test
+    void testYamlConfigurationParsing() throws FlinkParseException {
+        final String configDir = "/foo/bar";
+        final String key = "key";
+        final String value = "value";
+        final String newValue = "value2";
+        final String[] args = {
+            "--configDir",
+            configDir,
+            "--removeKey",
+            key,
+            String.format("-D%s=%s", key, value),
+            "--removeKeyValue",
+            String.format("%s=%s", key, value),
+            "--replaceKeyValue",
+            String.format("%s,%s,%s", key, value, newValue),
+            "--flatten"

Review Comment:
   IIUC, the long name is `flattenConfig`?



##########
flink-runtime/src/main/java/org/apache/flink/runtime/entrypoint/parser/CommandLineOptions.java:
##########
@@ -43,6 +43,42 @@ public class CommandLineOptions {
                     .desc("Port for the rest endpoint and the web UI.")
                     .build();
 
+    public static final Option REPLACE_KEY_VALUE_OPTION =

Review Comment:
   Other options are intended to be used by users. It's better to move these 
new options to a separate place.



-- 
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