ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbhowm...@apache.org
Subject ambari git commit: AMBARI-17139. View Config- views created for 2nd remote cluster points to 1st remote cluster. (Gaurav Nagar via dipayanb)
Date Tue, 14 Jun 2016 09:52:58 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk bfa6af8af -> 08fcdab6d


AMBARI-17139. View Config- views created for 2nd remote cluster points to 1st remote cluster.
(Gaurav Nagar via dipayanb)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/08fcdab6
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/08fcdab6
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/08fcdab6

Branch: refs/heads/trunk
Commit: 08fcdab6d758c7e0cfebf026f0dab358f580232f
Parents: bfa6af8
Author: Dipayan Bhowmick <dipayan.bhowmick@gmail.com>
Authored: Tue Jun 14 15:21:43 2016 +0530
Committer: Dipayan Bhowmick <dipayan.bhowmick@gmail.com>
Committed: Tue Jun 14 15:22:45 2016 +0530

----------------------------------------------------------------------
 .../server/view/RemoteAmbariClusterRegistry.java    | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/08fcdab6/ambari-server/src/main/java/org/apache/ambari/server/view/RemoteAmbariClusterRegistry.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/view/RemoteAmbariClusterRegistry.java
b/ambari-server/src/main/java/org/apache/ambari/server/view/RemoteAmbariClusterRegistry.java
index c0c887f..fb59485 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/view/RemoteAmbariClusterRegistry.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/view/RemoteAmbariClusterRegistry.java
@@ -38,7 +38,7 @@ import java.util.concurrent.ConcurrentHashMap;
 @Singleton
 public class RemoteAmbariClusterRegistry {
 
-  private ConcurrentHashMap<String,RemoteAmbariCluster> clusterMap = new ConcurrentHashMap<String,RemoteAmbariCluster>();
+  private ConcurrentHashMap<Long,RemoteAmbariCluster> clusterMap = new ConcurrentHashMap<Long,RemoteAmbariCluster>();
 
   @Inject
   private RemoteAmbariClusterDAO remoteAmbariClusterDAO;
@@ -46,12 +46,12 @@ public class RemoteAmbariClusterRegistry {
   @Inject
   private Configuration configuration;
 
-  public RemoteAmbariCluster get(Long clusterId){
+  public RemoteAmbariCluster get(Long clusterId) {
     RemoteAmbariCluster remoteAmbariCluster = clusterMap.get(clusterId);
-    if(remoteAmbariCluster == null){
+    if (remoteAmbariCluster == null) {
       RemoteAmbariCluster cluster = getCluster(clusterId);
-      RemoteAmbariCluster oldCluster = clusterMap.putIfAbsent(cluster.getName(), cluster);
-      if(oldCluster == null) remoteAmbariCluster = cluster;
+      RemoteAmbariCluster oldCluster = clusterMap.putIfAbsent(clusterId, cluster);
+      if (oldCluster == null) remoteAmbariCluster = cluster;
       else remoteAmbariCluster = oldCluster;
     }
     return remoteAmbariCluster;
@@ -69,7 +69,7 @@ public class RemoteAmbariClusterRegistry {
    *
    * @param entity
    */
-  public void update(RemoteAmbariClusterEntity entity){
+  public void update(RemoteAmbariClusterEntity entity) {
     remoteAmbariClusterDAO.update(entity);
     clusterMap.remove(entity.getName());
   }
@@ -106,9 +106,9 @@ public class RemoteAmbariClusterRegistry {
 
     entity.setServices(serviceEntities);
 
-    if(update){
+    if (update) {
       update(entity);
-    }else{
+    } else {
       remoteAmbariClusterDAO.save(entity);
     }
   }


Mime
View raw message