incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r1179807 - in /incubator/ambari/trunk: CHANGES.txt controller/src/main/java/org/apache/ambari/resource/statemachine/StateMachineInvoker.java
Date Thu, 06 Oct 2011 20:08:18 GMT
Author: ddas
Date: Thu Oct  6 20:08:18 2011
New Revision: 1179807

URL: http://svn.apache.org/viewvc?rev=1179807&view=rev
Log:
Changes the API StateMachineInvoker.getStateMachineClusterInstance to take blueprint related
arguments. Contributed by Devaraj Das.

Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/resource/statemachine/StateMachineInvoker.java

Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1179807&r1=1179806&r2=1179807&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Thu Oct  6 20:08:18 2011
@@ -2,7 +2,10 @@ Ambari Change log
 
 Release 0.1.0 - unreleased
 
-  AMBARI-45. Rename the Role/Cluster/Service classes in the statemachine package to 
+  AMBARI-43. Change the API StateMachineInvoker.getStateMachineClusterInstance 
+  to take blueprint related arguments. (ddas)
+
+  AMBARI-41. Rename the Role/Cluster/Service classes in the statemachine package to 
   RoleFSM/ClusterFSM/ServiceFSM (ddas)
 
   AMBARI-37. Tidies up a bit the statemachine API and related classes (ddas)

Modified: incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/resource/statemachine/StateMachineInvoker.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/resource/statemachine/StateMachineInvoker.java?rev=1179807&r1=1179806&r2=1179807&view=diff
==============================================================================
--- incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/resource/statemachine/StateMachineInvoker.java
(original)
+++ incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/resource/statemachine/StateMachineInvoker.java
Thu Oct  6 20:08:18 2011
@@ -18,7 +18,6 @@
 package org.apache.ambari.resource.statemachine;
 
 import java.io.IOException;
-import java.util.List;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 
@@ -73,13 +72,21 @@ public class StateMachineInvoker {
   private static ConcurrentMap<String, ClusterFSM> clusters = 
       new ConcurrentHashMap<String, ClusterFSM>();
   
+  private static String getClusterKey(String clusterId,
+      String blueprintName, String blueprintRev) {
+    return clusterId + blueprintName + blueprintRev;
+  }
+  
   public static ClusterFSM createCluster(Cluster cluster) throws IOException {
     ClusterImpl clusterFSM = new ClusterImpl(cluster);
-    clusters.put(cluster.getID(), clusterFSM);
+    clusters.put(getClusterKey(cluster.getID(), 
+        cluster.getClusterDefinition().getBlueprintName(), 
+        cluster.getClusterDefinition().getBlueprintRevision()), clusterFSM);
     return clusterFSM;
   }
   
-  public static ClusterFSM getStateMachineClusterInstance(String clusterId) {
-    return clusters.get(clusterId);
+  public static ClusterFSM getStateMachineClusterInstance(String clusterId,
+      String blueprintName, String blueprintRev) {
+    return clusters.get(getClusterKey(clusterId, blueprintName, blueprintRev));
   }    
 }



Mime
View raw message