You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2021/10/09 04:43:18 UTC

[GitHub] [flink] horacehylee commented on a change in pull request #16821: [FLINK-23358][core] Refactor CoreOptions parent first patterns to List options

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



##########
File path: flink-core/src/main/java/org/apache/flink/configuration/CoreOptions.java
##########
@@ -94,24 +101,39 @@
      * </ul>
      */
     @Documentation.Section(Documentation.Sections.EXPERT_CLASS_LOADING)
-    public static final ConfigOption<String> ALWAYS_PARENT_FIRST_LOADER_PATTERNS =
+    public static final ConfigOption<List<String>> ALWAYS_PARENT_FIRST_LOADER_PATTERNS =
             ConfigOptions.key("classloader.parent-first-patterns.default")
-                    .defaultValue(
-                            "java.;scala.;org.apache.flink.;com.esotericsoftware.kryo;org.apache.hadoop.;javax.annotation.;org.xml;javax.xml;org.apache.xerces;org.w3c;"
-                                    + PARENT_FIRST_LOGGING_PATTERNS)
+                    .stringType()
+                    .asList()
+                    .defaultValues(
+                            mergeListsToArray(
+                                    Arrays.asList(
+                                            "java.",
+                                            "scala.",
+                                            "org.apache.flink.",
+                                            "com.esotericsoftware.kryo",
+                                            "org.apache.hadoop.",
+                                            "javax.annotation.",
+                                            "org.xml",
+                                            "javax.xml",
+                                            "org.apache.xerces",
+                                            "org.w3c"),
+                                    PARENT_FIRST_LOGGING_PATTERNS))
                     .withDeprecatedKeys("classloader.parent-first-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"

Review comment:
       Sure, updated the description accordingly.

##########
File path: flink-core/src/main/java/org/apache/flink/configuration/CoreOptions.java
##########
@@ -127,9 +149,13 @@
                                     + "thrown while trying to load a user code class.");
 
     public static String[] getParentFirstLoaderPatterns(Configuration config) {
-        String base = config.getString(ALWAYS_PARENT_FIRST_LOADER_PATTERNS);
-        String append = config.getString(ALWAYS_PARENT_FIRST_LOADER_PATTERNS_ADDITIONAL);
-        return parseParentFirstLoaderPatterns(base, append);
+        List<String> base =
+                ConfigUtils.decodeListFromConfig(
+                        config, ALWAYS_PARENT_FIRST_LOADER_PATTERNS, String::new);
+        List<String> append =
+                ConfigUtils.decodeListFromConfig(
+                        config, ALWAYS_PARENT_FIRST_LOADER_PATTERNS_ADDITIONAL, String::new);

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"

Review comment:
       Sure, updated the description accordingly.




-- 
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-unsubscribe@flink.apache.org

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