zixi0825 commented on a change in pull request #6718:
URL: https://github.com/apache/dolphinscheduler/pull/6718#discussion_r753802833



##########
File path: 
dolphinscheduler-data-quality/src/main/java/org/apache/dolphinscheduler/data/quality/utils/ConfigUtils.java
##########
@@ -0,0 +1,56 @@
+/*
+ * 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.dolphinscheduler.data.quality.utils;
+
+import org.apache.dolphinscheduler.data.quality.config.Config;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+public class ConfigUtils {
+
+    private ConfigUtils() {
+        throw new IllegalStateException("Construct ConfigUtils");
+    }
+
+    /**
+     * Extract sub config with fixed prefix
+     *
+     * @param source config source
+     * @param prefix config prefix
+     * @param keepPrefix true if keep prefix
+     */
+    public static Config extractSubConfig(Config source, String prefix, 
boolean keepPrefix) {
+        Map<String, Object> values = new LinkedHashMap<>();
+
+        for (Map.Entry<String, Object> entry : source.entrySet()) {
+            final String key = entry.getKey();
+            final String value = String.valueOf(entry.getValue());
+
+            if (key.startsWith(prefix)) {
+                if (keepPrefix) {
+                    values.put(key, value);
+                } else {
+                    values.put(key.substring(prefix.length()), value);
+                }
+            }
+        }
+
+        return new Config(values);
+    }

Review comment:
       This utils will be used more frequently with the increase of readers

##########
File path: dolphinscheduler-dist/src/main/provisio/dolphinscheduler.xml
##########
@@ -131,4 +131,9 @@
             <unpack/>
         </artifact>
     </artifactSet>
+    <artifactSet to="lib/plugin/task/dataquality">

Review comment:
       All plugin artifactset write in this file,no need move to 
data-quality-plugin module




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