asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mb...@apache.org
Subject asterixdb git commit: [NO ISSUE][*DB][CONF][CLUS] Update node config on CC on join
Date Thu, 10 Aug 2017 15:25:59 GMT
Repository: asterixdb
Updated Branches:
  refs/heads/master a6d9b093a -> 759b6987e


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

Change-Id: If8c1471a1c418b435598e47aa6962f038b3d8281
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1927
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Contrib: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Murtadha Hubail <mhubail@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/759b6987
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/759b6987
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/759b6987

Branch: refs/heads/master
Commit: 759b6987e12d57f945dbb0095cf111d9b01e0315
Parents: a6d9b09
Author: Michael Blow <mblow@apache.org>
Authored: Thu Aug 10 09:42:35 2017 -0400
Committer: Michael Blow <mblow@apache.org>
Committed: Thu Aug 10 08:25:16 2017 -0700

----------------------------------------------------------------------
 .../asterix/runtime/utils/ClusterStateManager.java    | 14 ++++++++++++++
 .../hyracks/control/common/config/ConfigManager.java  |  2 +-
 2 files changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/759b6987/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/ClusterStateManager.java
----------------------------------------------------------------------
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..cdb3112 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
@@ -43,8 +43,11 @@ import org.apache.asterix.event.schema.cluster.Cluster;
 import org.apache.asterix.event.schema.cluster.Node;
 import org.apache.hyracks.algebricks.common.constraints.AlgebricksAbsolutePartitionConstraint;
 import org.apache.hyracks.api.config.IOption;
+import org.apache.hyracks.api.config.Section;
 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 +110,7 @@ public class ClusterStateManager implements IClusterStateManager {
         activeNcConfiguration.put(nodeId, configuration);
         failedNodes.remove(nodeId);
         ftStrategy.notifyNodeJoin(nodeId);
+        updateNodeConfig(nodeId, configuration);
     }
 
     @Override
@@ -418,4 +422,14 @@ public class ClusterStateManager implements IClusterStateManager {
         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()) {
+            if (entry.getKey().section() == Section.NC) {
+                configManager.set(nodeId, entry.getKey(), entry.getValue());
+            }
+        }
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/759b6987/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/config/ConfigManager.java
----------------------------------------------------------------------
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..2e04e13 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
@@ -166,7 +166,7 @@ public class ConfigManager implements IConfigManager, Serializable {
 
     private Map<IOption, Object> createNodeSpecificMap(String nodeId) {
         LOGGER.fine("createNodeSpecificMap: " + nodeId);
-        return new HashMap<>();
+        return Collections.synchronizedMap(new HashMap<>());
     }
 
     @Override


Mime
View raw message