You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by db...@apache.org on 2016/06/14 09:52:10 UTC

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

Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 7bed05350 -> 92dbf64ca


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/92dbf64c
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/92dbf64c
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/92dbf64c

Branch: refs/heads/branch-2.4
Commit: 92dbf64caae7fbe608558454b5afa230847da8e7
Parents: 7bed053
Author: Dipayan Bhowmick <di...@gmail.com>
Authored: Tue Jun 14 15:21:43 2016 +0530
Committer: Dipayan Bhowmick <di...@gmail.com>
Committed: Tue Jun 14 15:21:43 2016 +0530

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


http://git-wip-us.apache.org/repos/asf/ambari/blob/92dbf64c/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);
     }
   }