helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ka...@apache.org
Subject git commit: [HELIX-284] Support participant auto join in YAML cluster setup (fix issue), rb=15070
Date Thu, 31 Oct 2013 17:29:25 GMT
Updated Branches:
  refs/heads/master 463f3a941 -> 181073db7


[HELIX-284] Support participant auto join in YAML cluster setup (fix issue), rb=15070


Project: http://git-wip-us.apache.org/repos/asf/incubator-helix/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-helix/commit/181073db
Tree: http://git-wip-us.apache.org/repos/asf/incubator-helix/tree/181073db
Diff: http://git-wip-us.apache.org/repos/asf/incubator-helix/diff/181073db

Branch: refs/heads/master
Commit: 181073db77e34f76b22a2c9dbbbfbaa537b7fc94
Parents: 463f3a9
Author: Kanak Biscuitwala <kanak@apache.org>
Authored: Wed Oct 30 15:50:36 2013 -0700
Committer: Kanak Biscuitwala <kanak@apache.org>
Committed: Thu Oct 31 10:23:52 2013 -0700

----------------------------------------------------------------------
 .../apache/helix/tools/YAMLClusterSetup.java    | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/181073db/helix-core/src/main/java/org/apache/helix/tools/YAMLClusterSetup.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/tools/YAMLClusterSetup.java b/helix-core/src/main/java/org/apache/helix/tools/YAMLClusterSetup.java
index 07991a6..9ec1ef9 100644
--- a/helix-core/src/main/java/org/apache/helix/tools/YAMLClusterSetup.java
+++ b/helix-core/src/main/java/org/apache/helix/tools/YAMLClusterSetup.java
@@ -103,6 +103,26 @@ public class YAMLClusterSetup {
           StateModelDefinition stateModelDef =
               getStateModelDef(resource.stateModel, resource.constraints);
           helixAdmin.addStateModelDef(cfg.clusterName, resource.stateModel.name, stateModelDef);
+        } else {
+          StateModelDefinition stateModelDef = null;
+          if (resource.stateModel.name.equals("MasterSlave")) {
+            stateModelDef =
+                new StateModelDefinition(StateModelConfigGenerator.generateConfigForMasterSlave());
+          } else if (resource.stateModel.name.equals("OnlineOffline")) {
+            stateModelDef =
+                new StateModelDefinition(StateModelConfigGenerator.generateConfigForOnlineOffline());
+          } else if (resource.stateModel.name.equals("LeaderStandby")) {
+            stateModelDef =
+                new StateModelDefinition(StateModelConfigGenerator.generateConfigForLeaderStandby());
+          }
+          if (stateModelDef != null) {
+            try {
+              helixAdmin.addStateModelDef(cfg.clusterName, resource.stateModel.name, stateModelDef);
+            } catch (HelixException e) {
+              LOG.warn("State model definition " + resource.stateModel.name
+                  + " could not be added.");
+            }
+          }
         }
         int partitions = 1;
         int replicas = 1;


Mime
View raw message