horacehylee commented on a change in pull request #16821:
URL: https://github.com/apache/flink/pull/16821#discussion_r725431881



##########
File path: 
flink-core/src/main/java/org/apache/flink/configuration/CoreOptions.java
##########
@@ -36,8 +38,13 @@
 public class CoreOptions {
 
     @Internal
-    public static final String PARENT_FIRST_LOGGING_PATTERNS =
-            
"org.slf4j;org.apache.log4j;org.apache.logging;org.apache.commons.logging;ch.qos.logback";
+    public static final List<String> PARENT_FIRST_LOGGING_PATTERNS =
+            Arrays.asList(
+                    "org.slf4j",
+                    "org.apache.log4j",
+                    "org.apache.logging",
+                    "org.apache.commons.logging",
+                    "ch.qos.logback");

Review comment:
       Yes it will be much nicer with `String[]`

##########
File path: 
flink-core/src/main/java/org/apache/flink/configuration/CoreOptions.java
##########
@@ -151,43 +177,50 @@
     @Documentation.ExcludeFromDocumentation(
             "Plugin classloader list is considered an implementation detail. "
                     + "Configuration only included in case to mitigate 
unintended side-effects of this young feature.")
-    public static final ConfigOption<String> 
PLUGIN_ALWAYS_PARENT_FIRST_LOADER_PATTERNS =
+    public static final ConfigOption<List<String>> 
PLUGIN_ALWAYS_PARENT_FIRST_LOADER_PATTERNS =
             
ConfigOptions.key("plugin.classloader.parent-first-patterns.default")
                     .stringType()
-                    .defaultValue(
-                            "java.;org.apache.flink.;javax.annotation.;"
-                                    + PARENT_FIRST_LOGGING_PATTERNS)
+                    .asList()
+                    .defaultValues(
+                            mergeListsToArray(
+                                    Arrays.asList(
+                                            "java.", "org.apache.flink.", 
"javax.annotation."),
+                                    PARENT_FIRST_LOGGING_PATTERNS))
                     .withDescription(
-                            "A (semicolon-separated) list of patterns that 
specifies which classes should always be"
+                            "A list of patterns that specifies which classes 
should always be"
                                     + " resolved through the plugin parent 
ClassLoader first. A pattern is a simple prefix that is checked "
                                     + " against the fully qualified class 
name. This setting should generally not be modified. To add another "
                                     + " pattern we recommend to use 
\"plugin.classloader.parent-first-patterns.additional\" instead.");
 
     @Documentation.ExcludeFromDocumentation(
             "Plugin classloader list is considered an implementation detail. "
                     + "Configuration only included in case to mitigate 
unintended side-effects of this young feature.")
-    public static final ConfigOption<String> 
PLUGIN_ALWAYS_PARENT_FIRST_LOADER_PATTERNS_ADDITIONAL =
-            
ConfigOptions.key("plugin.classloader.parent-first-patterns.additional")
-                    .stringType()
-                    .defaultValue("")
-                    .withDescription(
-                            "A (semicolon-separated) list of patterns that 
specifies which classes should always be"
-                                    + " resolved through the plugin parent 
ClassLoader first. A pattern is a simple prefix that is checked "
-                                    + " against the fully qualified class 
name. These patterns are appended to \""
-                                    + 
PLUGIN_ALWAYS_PARENT_FIRST_LOADER_PATTERNS.key()
-                                    + "\".");
+    public static final ConfigOption<List<String>>
+            PLUGIN_ALWAYS_PARENT_FIRST_LOADER_PATTERNS_ADDITIONAL =
+                    
ConfigOptions.key("plugin.classloader.parent-first-patterns.additional")
+                            .stringType()
+                            .asList()
+                            .noDefaultValue()
+                            .withDescription(
+                                    "A list of patterns that specifies which 
classes should always be"

Review comment:
       Sure, updated the description accordingly.

##########
File path: 
flink-core/src/main/java/org/apache/flink/configuration/CoreOptions.java
##########
@@ -151,43 +177,50 @@
     @Documentation.ExcludeFromDocumentation(
             "Plugin classloader list is considered an implementation detail. "
                     + "Configuration only included in case to mitigate 
unintended side-effects of this young feature.")
-    public static final ConfigOption<String> 
PLUGIN_ALWAYS_PARENT_FIRST_LOADER_PATTERNS =
+    public static final ConfigOption<List<String>> 
PLUGIN_ALWAYS_PARENT_FIRST_LOADER_PATTERNS =
             
ConfigOptions.key("plugin.classloader.parent-first-patterns.default")
                     .stringType()
-                    .defaultValue(
-                            "java.;org.apache.flink.;javax.annotation.;"
-                                    + PARENT_FIRST_LOGGING_PATTERNS)
+                    .asList()
+                    .defaultValues(
+                            mergeListsToArray(
+                                    Arrays.asList(
+                                            "java.", "org.apache.flink.", 
"javax.annotation."),
+                                    PARENT_FIRST_LOGGING_PATTERNS))
                     .withDescription(
-                            "A (semicolon-separated) list of patterns that 
specifies which classes should always be"
+                            "A list of patterns that specifies which classes 
should always be"
                                     + " resolved through the plugin parent 
ClassLoader first. A pattern is a simple prefix that is checked "
                                     + " against the fully qualified class 
name. This setting should generally not be modified. To add another "
                                     + " pattern we recommend to use 
\"plugin.classloader.parent-first-patterns.additional\" instead.");
 
     @Documentation.ExcludeFromDocumentation(
             "Plugin classloader list is considered an implementation detail. "
                     + "Configuration only included in case to mitigate 
unintended side-effects of this young feature.")
-    public static final ConfigOption<String> 
PLUGIN_ALWAYS_PARENT_FIRST_LOADER_PATTERNS_ADDITIONAL =
-            
ConfigOptions.key("plugin.classloader.parent-first-patterns.additional")
-                    .stringType()
-                    .defaultValue("")
-                    .withDescription(
-                            "A (semicolon-separated) list of patterns that 
specifies which classes should always be"
-                                    + " resolved through the plugin parent 
ClassLoader first. A pattern is a simple prefix that is checked "
-                                    + " against the fully qualified class 
name. These patterns are appended to \""
-                                    + 
PLUGIN_ALWAYS_PARENT_FIRST_LOADER_PATTERNS.key()
-                                    + "\".");
+    public static final ConfigOption<List<String>>
+            PLUGIN_ALWAYS_PARENT_FIRST_LOADER_PATTERNS_ADDITIONAL =
+                    
ConfigOptions.key("plugin.classloader.parent-first-patterns.additional")
+                            .stringType()
+                            .asList()
+                            .noDefaultValue()

Review comment:
       Updated

##########
File path: 
flink-core/src/main/java/org/apache/flink/configuration/CoreOptions.java
##########
@@ -151,43 +177,50 @@
     @Documentation.ExcludeFromDocumentation(
             "Plugin classloader list is considered an implementation detail. "
                     + "Configuration only included in case to mitigate 
unintended side-effects of this young feature.")
-    public static final ConfigOption<String> 
PLUGIN_ALWAYS_PARENT_FIRST_LOADER_PATTERNS =
+    public static final ConfigOption<List<String>> 
PLUGIN_ALWAYS_PARENT_FIRST_LOADER_PATTERNS =
             
ConfigOptions.key("plugin.classloader.parent-first-patterns.default")
                     .stringType()
-                    .defaultValue(
-                            "java.;org.apache.flink.;javax.annotation.;"
-                                    + PARENT_FIRST_LOGGING_PATTERNS)
+                    .asList()
+                    .defaultValues(
+                            mergeListsToArray(
+                                    Arrays.asList(
+                                            "java.", "org.apache.flink.", 
"javax.annotation."),
+                                    PARENT_FIRST_LOGGING_PATTERNS))
                     .withDescription(
-                            "A (semicolon-separated) list of patterns that 
specifies which classes should always be"
+                            "A list of patterns that specifies which classes 
should always be"
                                     + " resolved through the plugin parent 
ClassLoader first. A pattern is a simple prefix that is checked "
                                     + " against the fully qualified class 
name. This setting should generally not be modified. To add another "
                                     + " pattern we recommend to use 
\"plugin.classloader.parent-first-patterns.additional\" instead.");
 
     @Documentation.ExcludeFromDocumentation(
             "Plugin classloader list is considered an implementation detail. "
                     + "Configuration only included in case to mitigate 
unintended side-effects of this young feature.")
-    public static final ConfigOption<String> 
PLUGIN_ALWAYS_PARENT_FIRST_LOADER_PATTERNS_ADDITIONAL =
-            
ConfigOptions.key("plugin.classloader.parent-first-patterns.additional")
-                    .stringType()
-                    .defaultValue("")
-                    .withDescription(
-                            "A (semicolon-separated) list of patterns that 
specifies which classes should always be"
-                                    + " resolved through the plugin parent 
ClassLoader first. A pattern is a simple prefix that is checked "
-                                    + " against the fully qualified class 
name. These patterns are appended to \""
-                                    + 
PLUGIN_ALWAYS_PARENT_FIRST_LOADER_PATTERNS.key()
-                                    + "\".");
+    public static final ConfigOption<List<String>>
+            PLUGIN_ALWAYS_PARENT_FIRST_LOADER_PATTERNS_ADDITIONAL =
+                    
ConfigOptions.key("plugin.classloader.parent-first-patterns.additional")
+                            .stringType()
+                            .asList()
+                            .noDefaultValue()
+                            .withDescription(
+                                    "A list of patterns that specifies which 
classes should always be"
+                                            + " resolved through the plugin 
parent ClassLoader first. A pattern is a simple prefix that is checked "
+                                            + " against the fully qualified 
class name. These patterns are appended to \""
+                                            + 
PLUGIN_ALWAYS_PARENT_FIRST_LOADER_PATTERNS.key()
+                                            + "\".");
 
     public static String[] getPluginParentFirstLoaderPatterns(Configuration 
config) {
-        String base = 
config.getString(PLUGIN_ALWAYS_PARENT_FIRST_LOADER_PATTERNS);
-        String append = 
config.getString(PLUGIN_ALWAYS_PARENT_FIRST_LOADER_PATTERNS_ADDITIONAL);
-        return parseParentFirstLoaderPatterns(base, append);
+        List<String> base =
+                ConfigUtils.decodeListFromConfig(
+                        config, PLUGIN_ALWAYS_PARENT_FIRST_LOADER_PATTERNS, 
String::new);
+        List<String> append =
+                ConfigUtils.decodeListFromConfig(
+                        config, 
PLUGIN_ALWAYS_PARENT_FIRST_LOADER_PATTERNS_ADDITIONAL, String::new);

Review comment:
       Updated




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to