incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgog...@apache.org
Subject svn commit: r1180505 - in /incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller: Cluster.java Clusters.java
Date Sat, 08 Oct 2011 23:19:25 GMT
Author: vgogate
Date: Sat Oct  8 23:19:25 2011
New Revision: 1180505

URL: http://svn.apache.org/viewvc?rev=1180505&view=rev
Log:
AMBARI-47

Modified:
    incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/Cluster.java
    incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/Clusters.java

Modified: incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/Cluster.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/Cluster.java?rev=1180505&r1=1180504&r2=1180505&view=diff
==============================================================================
--- incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/Cluster.java
(original)
+++ incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/Cluster.java
Sat Oct  8 23:19:25 2011
@@ -17,15 +17,8 @@
  */
 package org.apache.ambari.controller;
 
-import java.util.List;
-import java.util.concurrent.ConcurrentHashMap;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
 
+import java.util.concurrent.ConcurrentHashMap;
 import org.apache.ambari.common.rest.entities.ClusterDefinition;
 import org.apache.ambari.common.rest.entities.ClusterState;
 
@@ -48,7 +41,7 @@ public class Cluster {
     /*
      * Map of cluster revision to cluster definition
      */
-    protected ConcurrentHashMap<Long, ClusterDefinition> clusterDefinitionList = null;
+    protected ConcurrentHashMap<Long, ClusterDefinition> clusterDefinitionRevisionsList
= null;
     protected ClusterState clusterState;
     
     
@@ -70,35 +63,35 @@ public class Cluster {
      * @return the clusterDefinition
      */
     public ClusterDefinition getClusterDefinition(long revision) {
-            return clusterDefinitionList.get(revision);
+            return clusterDefinitionRevisionsList.get(revision);
     }
     
     /**
      * @return the latest clusterDefinition
      */
     public ClusterDefinition getLatestClusterDefinition() {
-        return clusterDefinitionList.get(this.latestRevision);
+        return clusterDefinitionRevisionsList.get(this.latestRevision);
     }
     
     /**
      * @return Add Cluster definition
      */
     public void addClusterDefinition(ClusterDefinition c) {
-        if (clusterDefinitionList == null) {
-            clusterDefinitionList = new ConcurrentHashMap<Long, ClusterDefinition>();
-            clusterDefinitionList.put((long)0, c);
+        if (clusterDefinitionRevisionsList == null) {
+            clusterDefinitionRevisionsList = new ConcurrentHashMap<Long, ClusterDefinition>();
+            clusterDefinitionRevisionsList.put((long)0, c);
             this.latestRevision = 0;
         } else {
             this.latestRevision++;
-            clusterDefinitionList.put((long)this.latestRevision, c);
+            clusterDefinitionRevisionsList.put((long)this.latestRevision, c);
         }
     }
     
     /**
      * @return the clusterDefinitionList
      */
-    public ConcurrentHashMap<Long, ClusterDefinition> getClusterDefinitionList() {
-        return clusterDefinitionList;
+    public ConcurrentHashMap<Long, ClusterDefinition> getClusterDefinitionRevisionsList()
{
+        return clusterDefinitionRevisionsList;
     }
 
     /**

Modified: incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/Clusters.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/Clusters.java?rev=1180505&r1=1180504&r2=1180505&view=diff
==============================================================================
--- incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/Clusters.java
(original)
+++ incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/Clusters.java
Sat Oct  8 23:19:25 2011
@@ -468,7 +468,7 @@ public class Clusters {
          */
         ClusterDefinition newcd = new ClusterDefinition ();
         
-        synchronized (cls.getClusterDefinitionList()) {
+        synchronized (cls.getClusterDefinitionRevisionsList()) {
             if (c.getBlueprintName() != null) {
                 newcd.setBlueprintName(c.getBlueprintName());
             } else {



Mime
View raw message