You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@amoro.apache.org by "LiangDai-Mars (via GitHub)" <gi...@apache.org> on 2026/02/02 15:10:05 UTC

[PR] [FEATURE]Support Dynamic Config. [amoro]

LiangDai-Mars opened a new pull request, #4072:
URL: https://github.com/apache/amoro/pull/4072

   <!--
   Thanks for sending a pull request!
   
   Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://amoro.apache.org/how-to-contribute/
     2. If the PR is related to an issue in https://github.com/apache/amoro/issues, add '[AMORO-XXXX]' in your PR title, e.g., '[AMORO-XXXX] Your PR title ...'.
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][AMORO-XXXX] Your PR title ...'.
   -->
   
   ## Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you add a feature, you can talk about its use case.
     2. If you fix a bug, you can clarify why it is a bug.
     3. Use Fix/Resolve/Close #{ISSUE_NUMBER} to link this PR to its related issue
   -->
   
   Close #xxx.
   
   ## Brief change log
   <!--
   Clearly describe the changes made in modules, classes, methods, etc.
   -->
   
   -
   
   ## How was this patch tested?
   
   - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
   
   - [ ] Add screenshots for manual tests if appropriate
   
   - [ ] Run test locally before making a pull request
   
   ## Documentation
   
   - Does this pull request introduce a new feature? (yes / no)
   - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
   


-- 
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: commits-unsubscribe@amoro.apache.org

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


Re: [PR] [FEATURE]Support Dynamic Config. [amoro]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #4072:
URL: https://github.com/apache/amoro/pull/4072#issuecomment-4114497993

   This pull request has been closed due to lack of activity. This is not a judgement on the merit of the PR in any way. It is just a way of keeping the PR queue manageable. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.


-- 
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: commits-unsubscribe@amoro.apache.org

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


Re: [PR] [FEATURE]Support Dynamic Config. [amoro]

Posted by "baiyangtx (via GitHub)" <gi...@apache.org>.
baiyangtx commented on code in PR #4072:
URL: https://github.com/apache/amoro/pull/4072#discussion_r2767903383


##########
amoro-common/src/main/java/org/apache/amoro/ActivePlugin.java:
##########
@@ -30,6 +32,19 @@ public interface ActivePlugin extends AmoroPlugin {
    */
   void open(Map<String, String> properties);
 
+  /**
+   * Initialize and open the plugin with a {@link ConfigurationManager}.
+   *
+   * <p>The default implementation delegates to {@link #open(Map)} to keep existing plugins
+   * compatible. New plugins can override this method to make use of dynamic configuration.
+   *
+   * @param properties plugin properties
+   * @param configurationManager configuration manager used to fetch dynamic overrides
+   */
+  default void open(Map<String, String> properties, ConfigurationManager configurationManager) {

Review Comment:
   I suggest using `void open(Configuration configs)` instead.



##########
amoro-ams/src/main/java/org/apache/amoro/server/terminal/TerminalManager.java:
##########
@@ -93,6 +93,12 @@ public TerminalManager(Configurations conf, CatalogManager catalogManager) {
     gcThread.start();
   }
 
+  public TerminalManager(
+      org.apache.amoro.config.DynamicConfigurations dynamicConfigurations,
+      CatalogManager catalogManager) {
+    this((Configurations) dynamicConfigurations, catalogManager);
+  }
+

Review Comment:
   1. No need type casting.
   2. Import at file head.



##########
amoro-ams/src/main/java/org/apache/amoro/server/manager/AbstractPluginManager.java:
##########
@@ -69,11 +72,28 @@ public abstract class AbstractPluginManager<T extends ActivePlugin> implements P
   private final Map<String, T> foundedPlugins = new ConcurrentHashMap<>();
   private final Map<String, PluginConfiguration> pluginConfigs = Maps.newLinkedHashMap();
   private final String pluginCategory;
+  protected final Configurations serviceConfig;
   private final Class<T> pluginType;
+  private final ConfigurationManager configurationManager;
 
   @SuppressWarnings("unchecked")
   public AbstractPluginManager(String pluginCategory) {
+    this(pluginCategory, null, null);
+  }

Review Comment:
   I think this constructor may should be removed.



##########
amoro-common/src/main/java/org/apache/amoro/config/DynamicConfigurations.java:
##########
@@ -0,0 +1,198 @@
+/*
+ * 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.amoro.config;
+
+import java.time.Duration;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+
+/**
+ * DynamicConfigurations represents a configuration view that can be updated at runtime.
+ *
+ * <p>Each instance keeps a reference to the initial static {@link Configurations} (baseConfig) and
+ * asks a {@link ConfigurationManager} for service level or plugin level overrides during refresh.
+ * The effective configuration is always
+ *
+ * <pre>
+ *   currentConfig = merge(baseConfig, overridesFromManager)
+ * </pre>
+ *
+ * where overrides come from:
+ *
+ * <ul>
+ *   <li>AMS service level: {@link ConfigurationManager#getServerConfigurations()}.
+ *   <li>Plugin level: {@link ConfigurationManager#getPluginConfigurations(String, String)}.
+ * </ul>
+ *
+ * <p>This class extends {@link Configurations} so that it can be injected wherever a {@code
+ * Configurations} is expected. All getter methods defined in {@link Configurations} operate on the
+ * current merged configuration.
+ */
+public class DynamicConfigurations extends Configurations {

Review Comment:
   DynamicConfigurations and ConfigurationManager should be in ams module.



##########
amoro-ams/src/main/java/org/apache/amoro/server/process/ProcessService.java:
##########
@@ -76,6 +76,16 @@ public ProcessService(Configurations serviceConfig, TableService tableService) {
     this(serviceConfig, tableService, new ActionCoordinatorManager(), new ExecuteEngineManager());
   }
 
+  public ProcessService(
+      org.apache.amoro.config.DynamicConfigurations dynamicConfigurations,

Review Comment:
   Import class at file head.



-- 
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: commits-unsubscribe@amoro.apache.org

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


Re: [PR] [FEATURE]Support Dynamic Config. [amoro]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #4072: [FEATURE]Support Dynamic Config.
URL: https://github.com/apache/amoro/pull/4072


-- 
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: commits-unsubscribe@amoro.apache.org

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


Re: [PR] [FEATURE]Support Dynamic Config. [amoro]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #4072:
URL: https://github.com/apache/amoro/pull/4072#issuecomment-4064246034

   This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@amoro.apache.org list. Thank you for your contributions.


-- 
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: commits-unsubscribe@amoro.apache.org

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