asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Blow (Code Review)" <do-not-re...@asterixdb.incubator.apache.org>
Subject Change in asterixdb[master]: [NO ISSUE][*DB][CONF][CLUS] Update node config on CC on join
Date Tue, 08 Aug 2017 21:38:19 GMT
Michael Blow has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/1927

Change subject: [NO ISSUE][*DB][CONF][CLUS] Update node config on CC on join
......................................................................

[NO ISSUE][*DB][CONF][CLUS] Update node config on CC on join

Change-Id: If8c1471a1c418b435598e47aa6962f038b3d8281
---
M asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/ClusterStateManager.java
M hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/config/ConfigManager.java
2 files changed, 13 insertions(+), 1 deletion(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/27/1927/1

diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/ClusterStateManager.java
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/ClusterStateManager.java
index b22a257..76d93e5 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/ClusterStateManager.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/ClusterStateManager.java
@@ -45,6 +45,8 @@
 import org.apache.hyracks.api.config.IOption;
 import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.api.exceptions.HyracksException;
+import org.apache.hyracks.control.common.application.ConfigManagerApplicationConfig;
+import org.apache.hyracks.control.common.config.ConfigManager;
 import org.apache.hyracks.control.common.controllers.NCConfig;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
@@ -107,6 +109,7 @@
         activeNcConfiguration.put(nodeId, configuration);
         failedNodes.remove(nodeId);
         ftStrategy.notifyNodeJoin(nodeId);
+        updateNodeConfig(nodeId, configuration);
     }
 
     @Override
@@ -418,4 +421,12 @@
         return new HashSet<>(pendingRemoval);
     }
 
+    private void updateNodeConfig(String nodeId, Map<IOption, Object> configuration)
{
+        ConfigManager configManager = ((ConfigManagerApplicationConfig) appCtx.getServiceContext().getAppConfig())
+                .getConfigManager();
+        for (Map.Entry<IOption, Object> entry : configuration.entrySet()) {
+            configManager.set(nodeId, entry.getKey(), entry.getValue());
+        }
+    }
+
 }
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/config/ConfigManager.java
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/config/ConfigManager.java
index a595301..b385e64 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/config/ConfigManager.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/config/ConfigManager.java
@@ -34,6 +34,7 @@
 import java.util.Set;
 import java.util.SortedMap;
 import java.util.TreeMap;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.function.BiConsumer;
 import java.util.function.Consumer;
 import java.util.function.Function;
@@ -166,7 +167,7 @@
 
     private Map<IOption, Object> createNodeSpecificMap(String nodeId) {
         LOGGER.fine("createNodeSpecificMap: " + nodeId);
-        return new HashMap<>();
+        return new ConcurrentHashMap<>();
     }
 
     @Override

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1927
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If8c1471a1c418b435598e47aa6962f038b3d8281
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Michael Blow <mblow@apache.org>

Mime
View raw message