ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpapirkovs...@apache.org
Subject [1/5] ambari git commit: AMBARI-21591. Send execution commands to agents user topic via STOMP. (mpapirkovskyy)
Date Thu, 03 Aug 2017 16:07:13 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-3.0-perf db83ccd82 -> 44c1cb512


http://git-wip-us.apache.org/repos/asf/ambari/blob/44c1cb51/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
index c661ebc..9fc231c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
@@ -32,10 +32,13 @@ import java.util.TreeMap;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.agent.stomp.AgentConfigsHolder;
+import org.apache.ambari.server.agent.stomp.MetadataHolder;
 import org.apache.ambari.server.agent.stomp.dto.ClusterConfigs;
 import org.apache.ambari.server.api.services.AmbariMetaInfo;
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.controller.AmbariManagementController;
+import org.apache.ambari.server.controller.AmbariManagementControllerImpl;
 import org.apache.ambari.server.events.AgentConfigsUpdateEvent;
 import org.apache.ambari.server.orm.dao.ClusterDAO;
 import org.apache.ambari.server.orm.entities.ClusterConfigEntity;
@@ -52,6 +55,7 @@ import com.google.common.cache.Cache;
 import com.google.common.cache.CacheBuilder;
 import com.google.common.collect.Maps;
 import com.google.inject.Inject;
+import com.google.inject.Provider;
 import com.google.inject.Singleton;
 import com.google.inject.persist.Transactional;
 
@@ -105,6 +109,15 @@ public class ConfigHelper {
   public static final String FIRST_VERSION_TAG = "version1";
 
   @Inject
+  private Provider<MetadataHolder> m_metadataHolder;
+
+  @Inject
+  private Provider<AgentConfigsHolder> m_agentConfigsHolder;
+
+  @Inject
+  private Provider<AmbariManagementControllerImpl> m_ambariManagementController;
+
+  @Inject
   public ConfigHelper(Clusters c, AmbariMetaInfo metaInfo, Configuration configuration, ClusterDAO clusterDAO) {
     clusters = c;
     ambariMetaInfo = metaInfo;
@@ -748,7 +761,11 @@ public class ConfigHelper {
     for (PropertyInfo stackProperty : stackProperties) {
       if (stackProperty.getPropertyTypes().contains(propertyType)) {
         String stackPropertyConfigType = fileNameToConfigType(stackProperty.getFilename());
-        result.put(stackProperty, actualConfigs.get(stackPropertyConfigType).getProperties().get(stackProperty.getName()));
+        Config actualConfig = actualConfigs.get(stackPropertyConfigType);
+        if (actualConfig == null) {
+          continue;
+        }
+        result.put(stackProperty, actualConfig.getProperties().get(stackProperty.getName()));
       }
     }
 
@@ -825,7 +842,11 @@ public class ConfigHelper {
     for (PropertyInfo stackProperty : stackProperties) {
       if (stackProperty.getPropertyTypes().contains(propertyType)) {
         String stackPropertyConfigType = fileNameToConfigType(stackProperty.getFilename());
-        result.add(actualConfigs.get(stackPropertyConfigType).getProperties().get(stackProperty.getName()));
+        Config actualConfig = actualConfigs.get(stackPropertyConfigType);
+        if (actualConfig == null) {
+          continue;
+        }
+        result.add(actualConfig.getProperties().get(stackProperty.getName()));
       }
     }
 
@@ -1081,6 +1102,8 @@ public class ConfigHelper {
     if (baseConfig != null) {
       cluster.addDesiredConfig(authenticatedUserName,
           Collections.singleton(baseConfig), serviceVersionNote);
+      m_metadataHolder.get().updateData(m_ambariManagementController.get().getClusterMetadataOnConfigsUpdate(cluster));
+      m_agentConfigsHolder.get().updateData(cluster.getClusterId(), null);
     }
   }
 
@@ -1150,12 +1173,17 @@ public class ConfigHelper {
     }
 
     // create the configuration history entries
+    boolean added = false;
     for (Set<Config> configs : serviceMapped.values()) {
       if (!configs.isEmpty()) {
         cluster.addDesiredConfig(authenticatedUserName, configs, serviceVersionNote);
+        added = true;
       }
     }
-
+    if (added) {
+      m_metadataHolder.get().updateData(m_ambariManagementController.get().getClusterMetadataOnConfigsUpdate(cluster));
+      m_agentConfigsHolder.get().updateData(cluster.getClusterId(), null);
+    }
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/44c1cb51/ambari-server/src/main/java/org/apache/ambari/server/state/Service.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/Service.java b/ambari-server/src/main/java/org/apache/ambari/server/state/Service.java
index 1f8c18e..91884f6 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/Service.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/Service.java
@@ -19,6 +19,7 @@
 package org.apache.ambari.server.state;
 
 import java.util.Map;
+import java.util.Set;
 
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.controller.ServiceResponse;
@@ -37,6 +38,8 @@ public interface Service {
 
   Map<String, ServiceComponent> getServiceComponents();
 
+  Set<String> getServiceHosts();
+
   void addServiceComponents(Map<String, ServiceComponent> components)
       throws AmbariException;
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/44c1cb51/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponent.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponent.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponent.java
index 2e44a7f..d755568 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponent.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponent.java
@@ -19,6 +19,7 @@
 package org.apache.ambari.server.state;
 
 import java.util.Map;
+import java.util.Set;
 
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.controller.ServiceComponentResponse;
@@ -70,6 +71,8 @@ public interface ServiceComponent {
 
   Map<String, ServiceComponentHost> getServiceComponentHosts();
 
+  Set<String> getServiceComponentsHosts();
+
   ServiceComponentHost getServiceComponentHost(String hostname)
       throws AmbariException;
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/44c1cb51/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentHost.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentHost.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentHost.java
index 8e6d33b..08f9f41 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentHost.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentHost.java
@@ -130,7 +130,7 @@ public interface ServiceComponentHost {
    *
    * @param version component version (e.g. 2.2.0.0-2041)
    */
-  void setVersion(String version);
+  void setVersion(String version) throws AmbariException;
 
   /**
    * Gets the desired security state for this ServiceComponent

http://git-wip-us.apache.org/repos/asf/ambari/blob/44c1cb51/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java
index 3cd000f..32ecbf8 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java
@@ -19,8 +19,10 @@
 package org.apache.ambari.server.state;
 
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Map;
 import java.util.Map.Entry;
+import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.locks.ReadWriteLock;
@@ -266,6 +268,15 @@ public class ServiceComponentImpl implements ServiceComponent {
   }
 
   @Override
+  public Set<String> getServiceComponentsHosts() {
+    Set<String> serviceComponentsHosts = new HashSet<>();
+    for (ServiceComponentHost serviceComponentHost : getServiceComponentHosts().values()) {
+      serviceComponentsHosts.add(serviceComponentHost.getHostName());
+    }
+    return serviceComponentsHosts;
+  }
+
+  @Override
   public void addServiceComponentHosts(
       Map<String, ServiceComponentHost> hostComponents) throws AmbariException {
     // TODO validation

http://git-wip-us.apache.org/repos/asf/ambari/blob/44c1cb51/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java
index f9202e0..c22bfb2 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java
@@ -19,10 +19,13 @@
 package org.apache.ambari.server.state;
 
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.atomic.AtomicReference;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
 
@@ -73,6 +76,7 @@ public class ServiceImpl implements Service {
   private boolean isCredentialStoreSupported;
   private boolean isCredentialStoreRequired;
   private AmbariMetaInfo ambariMetaInfo;
+  private AtomicReference<MaintenanceState> maintenanceState = new AtomicReference<>();
 
   @Inject
   private ServiceConfigDAO serviceConfigDAO;
@@ -225,6 +229,15 @@ public class ServiceImpl implements Service {
   }
 
   @Override
+  public Set<String> getServiceHosts() {
+    Set<String> hostNames = new HashSet<>();
+    for (ServiceComponent serviceComponent  : getServiceComponents().values()) {
+      hostNames.addAll(serviceComponent.getServiceComponentsHosts());
+    }
+    return hostNames;
+  }
+
+  @Override
   public void addServiceComponents(
       Map<String, ServiceComponent> components) throws AmbariException {
     for (ServiceComponent sc : components.values()) {
@@ -613,7 +626,7 @@ public class ServiceImpl implements Service {
   public void setMaintenanceState(MaintenanceState state) {
     ServiceDesiredStateEntity serviceDesiredStateEntity = getServiceDesiredStateEntity();
     serviceDesiredStateEntity.setMaintenanceState(state);
-    serviceDesiredStateDAO.merge(serviceDesiredStateEntity);
+    maintenanceState.set(serviceDesiredStateDAO.merge(serviceDesiredStateEntity).getMaintenanceState());
 
     // broadcast the maintenance mode change
     MaintenanceModeEvent event = new MaintenanceModeEvent(state, this);
@@ -622,7 +635,10 @@ public class ServiceImpl implements Service {
 
   @Override
   public MaintenanceState getMaintenanceState() {
-    return getServiceDesiredStateEntity().getMaintenanceState();
+    if (maintenanceState.get() == null) {
+      maintenanceState.set(getServiceDesiredStateEntity().getMaintenanceState());
+    }
+    return maintenanceState.get();
   }
 
   private ClusterServiceEntity getServiceEntity() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/44c1cb51/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinitionHash.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinitionHash.java b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinitionHash.java
index 5896819..7690508 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinitionHash.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinitionHash.java
@@ -548,7 +548,8 @@ public class AlertDefinitionHash {
         m_actionQueue.dequeue(hostName,
             AgentCommandType.ALERT_EXECUTION_COMMAND);
 
-        m_actionQueue.enqueue(hostName, command);
+        // TODO implement alert execution commands logic
+        //m_actionQueue.enqueue(hostName, command);
       }
     } finally {
       m_actionQueueLock.unlock();

http://git-wip-us.apache.org/repos/asf/ambari/blob/44c1cb51/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java
index dea105e..c2ef5e7 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java
@@ -335,7 +335,11 @@ public class AlertUri {
       return false;
     }
 
-    if (m_port != other.m_port) {
+    if (m_connectionTimeout != other.m_connectionTimeout) {
+      return false;
+    }
+
+    if (m_port.intValue() != other.m_port.intValue()) {
       return false;
     }
     return true;

http://git-wip-us.apache.org/repos/asf/ambari/blob/44c1cb51/ambari-server/src/main/java/org/apache/ambari/server/state/alert/ParameterizedSource.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/ParameterizedSource.java b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/ParameterizedSource.java
index ed5ab5f..92c4920 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/ParameterizedSource.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/ParameterizedSource.java
@@ -21,6 +21,8 @@ import java.util.Collections;
 import java.util.List;
 
 import org.apache.ambari.server.state.AlertState;
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
 
 import com.google.gson.annotations.SerializedName;
 
@@ -261,4 +263,26 @@ public abstract class ParameterizedSource extends Source {
   public enum AlertParameterVisibility {
     VISIBLE, HIDDEN, READ_ONLY
   }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) return true;
+
+    if (!(o instanceof ParameterizedSource)) return false;
+
+    ParameterizedSource that = (ParameterizedSource) o;
+
+    return new EqualsBuilder()
+        .appendSuper(super.equals(o))
+        .append(m_parameters, that.m_parameters)
+        .isEquals();
+  }
+
+  @Override
+  public int hashCode() {
+    return new HashCodeBuilder(17, 37)
+        .appendSuper(super.hashCode())
+        .append(m_parameters)
+        .toHashCode();
+  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/44c1cb51/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
index 7b36254..4aaefab 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
@@ -17,6 +17,7 @@
  */
 package org.apache.ambari.server.state.alert;
 
+import com.fasterxml.jackson.annotation.JsonInclude;
 import com.google.gson.annotations.SerializedName;
 
 /**
@@ -206,6 +207,7 @@ public class Reporting {
    * Equality checking for instances of this class should be executed on every
    * member to ensure that reconciling stack differences is correct.
    */
+  @JsonInclude(JsonInclude.Include.NON_EMPTY)
   public static final class ReportTemplate {
     @SerializedName("text")
     private String m_text;

http://git-wip-us.apache.org/repos/asf/ambari/blob/44c1cb51/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Source.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Source.java b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Source.java
index 25a4a0a..76054a9 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Source.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Source.java
@@ -17,6 +17,7 @@
  */
 package org.apache.ambari.server.state.alert;
 
+import com.fasterxml.jackson.annotation.JsonInclude;
 import com.google.gson.annotations.SerializedName;
 
 /**
@@ -25,6 +26,7 @@ import com.google.gson.annotations.SerializedName;
  * Equality checking for instances of this class should be executed on every
  * member to ensure that reconciling stack differences is correct.
  */
+@JsonInclude(JsonInclude.Include.NON_EMPTY)
 public abstract class Source {
 
   private SourceType type;

http://git-wip-us.apache.org/repos/asf/ambari/blob/44c1cb51/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
index 5ad929d..7147ce3 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
@@ -2666,6 +2666,7 @@ public class ClusterImpl implements Cluster {
   @Transactional
   ServiceConfigVersionResponse applyConfigs(Set<Config> configs, String user, String serviceConfigVersionNote) {
 
+    List<ClusterConfigEntity> appliedConfigs = new ArrayList<>();
     String serviceName = null;
     for (Config config : configs) {
       for (Entry<String, String> entry : serviceConfigTypes.entries()) {
@@ -2698,19 +2699,20 @@ public class ClusterImpl implements Cluster {
 
           // unless both the tag and type match, then enable it
           if (StringUtils.equals(clusterConfigEntity.getTag(), config.getTag())) {
+            appliedConfigs.add(clusterConfigEntity);
             clusterConfigEntity.setSelected(true);
           }
         }
       }
     }
 
-    clusterEntity = clusterDAO.merge(clusterEntity);
-
     if (serviceName == null) {
       ArrayList<String> configTypes = new ArrayList<>();
       for (Config config: configs) {
         configTypes.add(config.getType());
       }
+
+      stateUpdateEventPublisher.publish(new ConfigsUpdateEvent(this, appliedConfigs));
       LOG.error("No service found for config types '{}', service config version not created", configTypes);
       return null;
     } else {

http://git-wip-us.apache.org/repos/asf/ambari/blob/44c1cb51/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java
index d59af00..aecfabe 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java
@@ -38,14 +38,16 @@ import org.apache.ambari.server.ClusterNotFoundException;
 import org.apache.ambari.server.DuplicateResourceException;
 import org.apache.ambari.server.HostNotFoundException;
 import org.apache.ambari.server.agent.DiskInfo;
+import org.apache.ambari.server.agent.stomp.MetadataHolder;
+import org.apache.ambari.server.agent.stomp.TopologyHolder;
 import org.apache.ambari.server.agent.stomp.dto.TopologyCluster;
 import org.apache.ambari.server.api.services.AmbariMetaInfo;
+import org.apache.ambari.server.controller.AmbariManagementControllerImpl;
 import org.apache.ambari.server.events.HostRegisteredEvent;
 import org.apache.ambari.server.events.HostsAddedEvent;
 import org.apache.ambari.server.events.HostsRemovedEvent;
 import org.apache.ambari.server.events.TopologyUpdateEvent;
 import org.apache.ambari.server.events.publishers.AmbariEventPublisher;
-import org.apache.ambari.server.events.publishers.StateUpdateEventPublisher;
 import org.apache.ambari.server.orm.dao.ClusterDAO;
 import org.apache.ambari.server.orm.dao.ClusterVersionDAO;
 import org.apache.ambari.server.orm.dao.HostConfigMappingDAO;
@@ -97,6 +99,7 @@ import org.springframework.security.core.GrantedAuthority;
 
 import com.google.common.collect.Sets;
 import com.google.inject.Inject;
+import com.google.inject.Provider;
 import com.google.inject.Singleton;
 import com.google.inject.persist.Transactional;
 
@@ -164,7 +167,13 @@ public class ClustersImpl implements Clusters {
   private AmbariEventPublisher eventPublisher;
 
   @Inject
-  private StateUpdateEventPublisher stateUpdateEventPublisher;
+  private Provider<TopologyHolder> m_topologyHolder;
+
+  @Inject
+  private Provider<MetadataHolder> m_metadataHolder;
+
+  @Inject
+  private Provider<AmbariManagementControllerImpl> m_ambariManagementController;
 
   @Inject
   public ClustersImpl(ClusterDAO clusterDAO, ClusterFactory clusterFactory, HostDAO hostDAO,
@@ -273,11 +282,11 @@ public class ClustersImpl implements Clusters {
 
     TreeMap<String, TopologyCluster> addedClusters = new TreeMap<>();
     TopologyCluster addedCluster = new TopologyCluster();
-    addedCluster.setClusterName(clusterName);
     addedClusters.put(Long.toString(cluster.getClusterId()), addedCluster);
     TopologyUpdateEvent topologyUpdateEvent = new TopologyUpdateEvent(addedClusters,
         TopologyUpdateEvent.EventType.UPDATE);
-    stateUpdateEventPublisher.publish(topologyUpdateEvent);
+    m_topologyHolder.get().updateData(topologyUpdateEvent);
+    m_metadataHolder.get().updateData(m_ambariManagementController.get().getClusterMetadata(cluster));
   }
 
   @Override
@@ -604,6 +613,8 @@ public class ClustersImpl implements Clusters {
   public void updateClusterName(String oldName, String newName) {
     clusters.put(newName, clusters.remove(oldName));
     clusterHostMap.put(newName, clusterHostMap.remove(oldName));
+
+    //TODO metadata update
   }
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/44c1cb51/ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java
index db228b1..0b54eec 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java
@@ -36,6 +36,8 @@ import org.apache.ambari.server.agent.HostInfo;
 import org.apache.ambari.server.agent.RecoveryReport;
 import org.apache.ambari.server.api.services.AmbariMetaInfo;
 import org.apache.ambari.server.controller.HostResponse;
+import org.apache.ambari.server.events.HostStateUpdateEvent;
+import org.apache.ambari.server.events.HostStatusUpdateEvent;
 import org.apache.ambari.server.events.MaintenanceModeEvent;
 import org.apache.ambari.server.events.publishers.AmbariEventPublisher;
 import org.apache.ambari.server.orm.cache.HostConfigMapping;
@@ -135,6 +137,9 @@ public class HostImpl implements Host {
   @Inject
   private AmbariMetaInfo ambariMetaInfo;
 
+  @Inject
+  private AmbariEventPublisher ambariEventPublisher;
+
   /**
    * The ID of the host which is to retrieve it from JPA.
    */
@@ -556,6 +561,7 @@ public class HostImpl implements Host {
   public void setState(HostState state) {
     stateMachine.setCurrentState(state);
     HostStateEntity hostStateEntity = getHostStateEntity();
+    ambariEventPublisher.publish(new HostStateUpdateEvent(getHostName(), state));
 
     if (hostStateEntity != null) {
       hostStateEntity.setCurrentState(state);
@@ -589,6 +595,7 @@ public class HostImpl implements Host {
       writeLock.unlock();
     }
     if (oldState != getState()) {
+      ambariEventPublisher.publish(new HostStateUpdateEvent(getHostName(), getState()));
       if (LOG.isDebugEnabled()) {
         LOG.debug("Host transitioned to a new state"
             + ", host=" + getHostName()
@@ -912,6 +919,9 @@ public class HostImpl implements Host {
 
   @Override
   public void setStatus(String status) {
+    if (this.status != status) {
+      ambariEventPublisher.publish(new HostStatusUpdateEvent(getHostName(), status));
+    }
     this.status = status;
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/44c1cb51/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
index 149481a..446ae8c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
@@ -28,19 +28,22 @@ import java.util.Map.Entry;
 import java.util.Set;
 import java.util.TreeMap;
 import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.atomic.AtomicReference;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReadWriteLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.agent.AlertDefinitionCommand;
+import org.apache.ambari.server.agent.stomp.TopologyHolder;
 import org.apache.ambari.server.agent.stomp.dto.TopologyCluster;
 import org.apache.ambari.server.agent.stomp.dto.TopologyComponent;
 import org.apache.ambari.server.api.services.AmbariMetaInfo;
 import org.apache.ambari.server.controller.ServiceComponentHostResponse;
 import org.apache.ambari.server.controller.internal.DeleteHostComponentStatusMetaData;
 import org.apache.ambari.server.events.AlertHashInvalidationEvent;
-import org.apache.ambari.server.events.HostComponentUpdateEvent;
+import org.apache.ambari.server.events.HostComponentUpdate;
+import org.apache.ambari.server.events.HostComponentsUpdateEvent;
 import org.apache.ambari.server.events.MaintenanceModeEvent;
 import org.apache.ambari.server.events.ServiceComponentInstalledEvent;
 import org.apache.ambari.server.events.ServiceComponentUninstalledEvent;
@@ -91,6 +94,7 @@ import org.slf4j.LoggerFactory;
 
 import com.google.common.collect.ImmutableList;
 import com.google.inject.Inject;
+import com.google.inject.Provider;
 import com.google.inject.assistedinject.Assisted;
 import com.google.inject.assistedinject.AssistedInject;
 import com.google.inject.persist.Transactional;
@@ -132,6 +136,9 @@ public class ServiceComponentHostImpl implements ServiceComponentHost {
   @Inject
   StateUpdateEventPublisher stateUpdateEventPublisher;
 
+  @Inject
+  private Provider<TopologyHolder> m_topologyHolder;
+
   /**
    * Used for creating commands to send to the agents when alert definitions are
    * added as the result of a service install.
@@ -153,7 +160,6 @@ public class ServiceComponentHostImpl implements ServiceComponentHost {
    * The desired component state entity id.
    */
   private final Long desiredStateEntityId;
-
   /**
    * Cache the generated id for host component state for fast lookups.
    */
@@ -162,6 +168,7 @@ public class ServiceComponentHostImpl implements ServiceComponentHost {
   private long lastOpStartTime;
   private long lastOpEndTime;
   private long lastOpLastUpdateTime;
+  private AtomicReference<MaintenanceState> maintenanceState = new AtomicReference<>();
 
   private ConcurrentMap<String, HostConfig> actualConfigs = new ConcurrentHashMap<>();
   private ImmutableList<Map<String, String>> processes = ImmutableList.of();
@@ -874,11 +881,16 @@ public class ServiceComponentHostImpl implements ServiceComponentHost {
 
   @Override
   public void setState(State state) {
+    State oldState = getState();
     stateMachine.setCurrentState(state);
     HostComponentStateEntity stateEntity = getStateEntity();
     if (stateEntity != null) {
       stateEntity.setCurrentState(state);
       stateEntity = hostComponentStateDAO.merge(stateEntity);
+      if (!oldState.equals(state)) {
+        stateUpdateEventPublisher.publish(new HostComponentsUpdateEvent(Collections.singletonList(
+            new HostComponentUpdate(stateEntity, oldState))));
+      }
     } else {
       LOG.warn("Setting a member on an entity object that may have been "
           + "previously deleted, serviceName = " + getServiceName() + ", " + "componentName = "
@@ -901,7 +913,7 @@ public class ServiceComponentHostImpl implements ServiceComponentHost {
   }
 
   @Override
-  public void setVersion(String version) {
+  public void setVersion(String version) throws AmbariException {
     HostComponentStateEntity stateEntity = getStateEntity();
     if (stateEntity != null) {
       stateEntity.setVersion(version);
@@ -918,7 +930,7 @@ public class ServiceComponentHostImpl implements ServiceComponentHost {
           .build());
       TopologyUpdateEvent hostComponentVersionUpdate = new TopologyUpdateEvent(topologyUpdates,
           TopologyUpdateEvent.EventType.UPDATE);
-      stateUpdateEventPublisher.publish(hostComponentVersionUpdate);
+      m_topologyHolder.get().updateData(hostComponentVersionUpdate);
     } else {
       LOG.warn("Setting a member on an entity object that may have been "
           + "previously deleted, serviceName = " + getServiceName() + ", " + "componentName = "
@@ -1035,7 +1047,8 @@ public class ServiceComponentHostImpl implements ServiceComponentHost {
         stateEntity.setCurrentState(stateMachine.getCurrentState());
         stateEntity = hostComponentStateDAO.merge(stateEntity);
         if (statusUpdated) {
-          stateUpdateEventPublisher.publish(new HostComponentUpdateEvent(stateEntity));
+          stateUpdateEventPublisher.publish(new HostComponentsUpdateEvent(Collections.singletonList(
+              new HostComponentUpdate(stateEntity, oldState))));
         }
         // TODO Audit logs
       } catch (InvalidStateTransitionException e) {
@@ -1510,7 +1523,7 @@ public class ServiceComponentHostImpl implements ServiceComponentHost {
     HostComponentDesiredStateEntity desiredStateEntity = getDesiredStateEntity();
     if (desiredStateEntity != null) {
       desiredStateEntity.setMaintenanceState(state);
-      hostComponentDesiredStateDAO.merge(desiredStateEntity);
+      maintenanceState.set(hostComponentDesiredStateDAO.merge(desiredStateEntity).getMaintenanceState());
 
       // broadcast the maintenance mode change
       MaintenanceModeEvent event = new MaintenanceModeEvent(state, this);
@@ -1524,7 +1537,10 @@ public class ServiceComponentHostImpl implements ServiceComponentHost {
 
   @Override
   public MaintenanceState getMaintenanceState() {
-    return getDesiredStateEntity().getMaintenanceState();
+    if (maintenanceState.get() == null) {
+      maintenanceState.set(getDesiredStateEntity().getMaintenanceState());
+    }
+    return maintenanceState.get();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/ambari/blob/44c1cb51/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyDeleteFormer.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyDeleteFormer.java b/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyDeleteFormer.java
index 1ba4cc9..b20d774 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyDeleteFormer.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyDeleteFormer.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -23,20 +23,21 @@ import java.util.HashSet;
 import java.util.TreeMap;
 
 import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.agent.stomp.TopologyHolder;
 import org.apache.ambari.server.agent.stomp.dto.TopologyCluster;
 import org.apache.ambari.server.agent.stomp.dto.TopologyComponent;
 import org.apache.ambari.server.controller.internal.DeleteHostComponentStatusMetaData;
 import org.apache.ambari.server.events.TopologyUpdateEvent;
-import org.apache.ambari.server.events.publishers.StateUpdateEventPublisher;
 
 import com.google.inject.Inject;
+import com.google.inject.Provider;
 import com.google.inject.Singleton;
 
 @Singleton
 public class TopologyDeleteFormer {
 
   @Inject
-  private StateUpdateEventPublisher stateUpdateEventPublisher;
+  private Provider<TopologyHolder> m_topologyHolder;
 
   public void processDeleteMetaDataException(DeleteHostComponentStatusMetaData metaData) throws AmbariException {
     if (metaData.getAmbariException() != null) {
@@ -45,27 +46,27 @@ public class TopologyDeleteFormer {
           createUpdateFromDeleteMetaData(metaData),
           TopologyUpdateEvent.EventType.DELETE
       );
-      stateUpdateEventPublisher.publish(topologyUpdateEvent);
+      m_topologyHolder.get().updateData(topologyUpdateEvent);
 
       throw metaData.getAmbariException();
     }
   }
-  public void processDeleteMetaData(DeleteHostComponentStatusMetaData metaData) {
+  public void processDeleteMetaData(DeleteHostComponentStatusMetaData metaData) throws AmbariException {
     TopologyUpdateEvent topologyUpdateEvent = new TopologyUpdateEvent(
         createUpdateFromDeleteMetaData(metaData),
         TopologyUpdateEvent.EventType.DELETE
     );
-    stateUpdateEventPublisher.publish(topologyUpdateEvent);
+    m_topologyHolder.get().updateData(topologyUpdateEvent);
   }
 
-  public void processDeleteCluster(String clusterId) {
+  public void processDeleteCluster(String clusterId) throws AmbariException {
     TreeMap<String, TopologyCluster> topologyUpdates = new TreeMap<>();
     topologyUpdates.put(clusterId, new TopologyCluster());
     TopologyUpdateEvent topologyUpdateEvent = new TopologyUpdateEvent(
         topologyUpdates,
         TopologyUpdateEvent.EventType.DELETE
     );
-    stateUpdateEventPublisher.publish(topologyUpdateEvent);
+    m_topologyHolder.get().updateData(topologyUpdateEvent);
   }
 
   public TreeMap<String, TopologyCluster> createUpdateFromDeleteMetaData(DeleteHostComponentStatusMetaData metaData) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/44c1cb51/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
index 6c59784..1f1c647 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
@@ -43,10 +43,13 @@ import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 
 import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.agent.stomp.AgentConfigsHolder;
+import org.apache.ambari.server.agent.stomp.MetadataHolder;
 import org.apache.ambari.server.api.services.AmbariMetaInfo;
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.configuration.Configuration.DatabaseType;
 import org.apache.ambari.server.controller.AmbariManagementController;
+import org.apache.ambari.server.controller.AmbariManagementControllerImpl;
 import org.apache.ambari.server.orm.DBAccessor;
 import org.apache.ambari.server.orm.dao.AlertDefinitionDAO;
 import org.apache.ambari.server.orm.dao.ArtifactDAO;
@@ -104,6 +107,12 @@ public abstract class AbstractUpgradeCatalog implements UpgradeCatalog {
   protected Configuration configuration;
   @Inject
   protected StackUpgradeUtil stackUpgradeUtil;
+  @Inject
+  protected Provider<AgentConfigsHolder> m_agentConfigsHolder;
+  @Inject
+  protected Provider<MetadataHolder> m_metadataHolder;
+  @Inject
+  protected AmbariManagementControllerImpl ambariManagementController;
 
   protected Injector injector;
 
@@ -601,6 +610,8 @@ public abstract class AbstractUpgradeCatalog implements UpgradeCatalog {
                 + "tag='" + baseConfig.getTag() + "'"
                 + oldConfigString);
             }
+            m_metadataHolder.get().updateData(ambariManagementController.getClusterMetadataOnConfigsUpdate(cluster));
+            m_agentConfigsHolder.get().updateData(cluster.getClusterId(), null);
           }
         } else {
           LOG.info("No changes detected to config " + configType + ". Skipping configuration properties update");

http://git-wip-us.apache.org/repos/asf/ambari/blob/44c1cb51/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
index b1a7524..67d2663 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
@@ -940,7 +940,7 @@ public class TestActionScheduler {
     s.getExecutionCommands(null).get(0).getExecutionCommand().setServiceName("Service name");
     s.getExecutionCommands(null).get(0).getExecutionCommand().setRoleCommand(roleCommand);
 
-    aq.enqueue(Stage.INTERNAL_HOSTNAME, s.getExecutionCommands(null).get(0).getExecutionCommand());
+    //aq.enqueue(Stage.INTERNAL_HOSTNAME, s.getExecutionCommands(null).get(0).getExecutionCommand());
     List<ExecutionCommand> commandsToSchedule = new ArrayList<>();
     Multimap<String, AgentCommand> commandsToEnqueue = ArrayListMultimap.create();
 
@@ -2635,7 +2635,7 @@ public class TestActionScheduler {
   }
 
   @Test
-  public void testAbortHolding() {
+  public void testAbortHolding() throws AmbariException {
     UnitOfWork unitOfWork = EasyMock.createMock(UnitOfWork.class);
     ActionDBAccessor db = EasyMock.createMock(ActionDBAccessor.class);
     ActionQueue aq = new ActionQueue();
@@ -2671,7 +2671,7 @@ public class TestActionScheduler {
   }
 
   @Test
-  public void testAbortAmbariServerAction() {
+  public void testAbortAmbariServerAction() throws AmbariException {
     UnitOfWork unitOfWork = EasyMock.createMock(UnitOfWork.class);
     ActionDBAccessor db = EasyMock.createMock(ActionDBAccessor.class);
     ActionQueue aq = new ActionQueue();

http://git-wip-us.apache.org/repos/asf/ambari/blob/44c1cb51/ambari-server/src/test/java/org/apache/ambari/server/agent/HeartbeatProcessorTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/agent/HeartbeatProcessorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/agent/HeartbeatProcessorTest.java
index 2dd91c0..9a6391c 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/agent/HeartbeatProcessorTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/agent/HeartbeatProcessorTest.java
@@ -192,13 +192,7 @@ public class HeartbeatProcessorTest {
     cr.setStdOut("");
     cr.setExitCode(215);
     cr.setRoleCommand("START");
-    cr.setClusterName(DummyCluster);
-
-    cr.setConfigurationTags(new HashMap<String, Map<String, String>>() {{
-      put("global", new HashMap<String, String>() {{
-        put("tag", "version1");
-      }});
-    }});
+    //cr.setClusterName(DummyCluster);
 
     reports.add(cr);
     hb.setReports(reports);
@@ -258,12 +252,7 @@ public class HeartbeatProcessorTest {
     cr.setStdErr("");
     cr.setStdOut("");
     cr.setExitCode(215);
-    cr.setClusterName(DummyCluster);
-    cr.setConfigurationTags(new HashMap<String, Map<String, String>>() {{
-      put("global", new HashMap<String, String>() {{
-        put("tag", "version1");
-      }});
-    }});
+    //cr.setClusterName(DummyCluster);
     reports.add(cr);
     hb.setReports(reports);
 
@@ -327,10 +316,7 @@ public class HeartbeatProcessorTest {
     cr.setStdErr("");
     cr.setStdOut("");
     cr.setExitCode(215);
-    cr.setClusterName(DummyCluster);
-    cr.setConfigurationTags(new HashMap<String, Map<String,String>>() {{
-      put("global", new HashMap<String,String>() {{ put("tag", "version1"); }});
-    }});
+    //cr.setClusterName(DummyCluster);
     CommandReport crn = new CommandReport();
     crn.setActionId(StageUtils.getActionId(requestId, stageId));
     crn.setServiceName(HDFS);
@@ -342,10 +328,7 @@ public class HeartbeatProcessorTest {
     crn.setStdErr("");
     crn.setStdOut("");
     crn.setExitCode(215);
-    crn.setClusterName(DummyCluster);
-    crn.setConfigurationTags(new HashMap<String, Map<String,String>>() {{
-      put("global", new HashMap<String,String>() {{ put("tag", "version1"); }});
-    }});
+    //crn.setClusterName(DummyCluster);
 
     reports.add(cr);
     reports.add(crn);
@@ -413,7 +396,7 @@ public class HeartbeatProcessorTest {
     cr.setStdErr("");
     cr.setStdOut("");
     cr.setExitCode(215);
-    cr.setClusterName(DummyCluster);
+    //cr.setClusterName(DummyCluster);
     CommandReport crn = new CommandReport();
     crn.setActionId(StageUtils.getActionId(requestId, stageId));
     crn.setServiceName(HDFS);
@@ -425,7 +408,7 @@ public class HeartbeatProcessorTest {
     crn.setStdErr("");
     crn.setStdOut("");
     crn.setExitCode(215);
-    crn.setClusterName(DummyCluster);
+    //crn.setClusterName(DummyCluster);
 
     reports.add(cr);
     reports.add(crn);
@@ -491,14 +474,14 @@ public class HeartbeatProcessorTest {
     hb.setReports(new ArrayList<CommandReport>());
     ArrayList<ComponentStatus> componentStatuses = new ArrayList<>();
     ComponentStatus componentStatus1 = new ComponentStatus();
-    componentStatus1.setClusterName(DummyCluster);
+    //componentStatus1.setClusterName(DummyCluster);
     componentStatus1.setServiceName(HDFS);
     componentStatus1.setMessage(DummyHostStatus);
     componentStatus1.setStatus(State.STARTED.name());
     componentStatus1.setComponentName(DATANODE);
     componentStatuses.add(componentStatus1);
     ComponentStatus componentStatus2 = new ComponentStatus();
-    componentStatus2.setClusterName(DummyCluster);
+    //componentStatus2.setClusterName(DummyCluster);
     componentStatus2.setServiceName(HDFS);
     componentStatus2.setMessage(DummyHostStatus);
     componentStatus2.setStatus(State.STARTED.name());
@@ -557,11 +540,6 @@ public class HeartbeatProcessorTest {
     cr.setStdOut("");
     cr.setExitCode(215);
 
-    cr.setConfigurationTags(new HashMap<String, Map<String,String>>() {{
-      put("global", new HashMap<String,String>() {{ put("tag", "version1"); }});
-    }});
-
-
     reports.add(cr);
     am.processTaskResponse(DummyHostname1, reports, CommandUtils.convertToTaskIdCommandMap(stage.getOrderedHostRoleCommands()));
     assertEquals(215,
@@ -607,7 +585,7 @@ public class HeartbeatProcessorTest {
     CommandReport cr = new CommandReport();
     cr.setActionId(StageUtils.getActionId(requestId, stageId));
     cr.setTaskId(1);
-    cr.setClusterName(DummyCluster);
+    //cr.setClusterName(DummyCluster);
     cr.setServiceName(HDFS);
     cr.setRole(DATANODE);
     cr.setStatus(HostRoleStatus.IN_PROGRESS.toString());
@@ -726,7 +704,7 @@ public class HeartbeatProcessorTest {
     CommandReport cr = new CommandReport();
     cr.setActionId(StageUtils.getActionId(requestId, stageId));
     cr.setTaskId(1);
-    cr.setClusterName(DummyCluster);
+    //cr.setClusterName(DummyCluster);
     cr.setServiceName(HDFS);
     cr.setRole(DATANODE);
     cr.setRoleCommand("INSTALL");
@@ -830,7 +808,7 @@ public class HeartbeatProcessorTest {
 
     ArrayList<ComponentStatus> componentStatuses = new ArrayList<>();
     ComponentStatus componentStatus1 = new ComponentStatus();
-    componentStatus1.setClusterName(DummyCluster);
+    //componentStatus1.setClusterName(DummyCluster);
     componentStatus1.setServiceName(HDFS);
     componentStatus1.setMessage(DummyHostStatus);
     componentStatus1.setStatus(State.STARTED.name());
@@ -865,7 +843,7 @@ public class HeartbeatProcessorTest {
     hb.setReports(new ArrayList<CommandReport>());
 
     componentStatus1 = new ComponentStatus();
-    componentStatus1.setClusterName(DummyCluster);
+    //componentStatus1.setClusterName(DummyCluster);
     componentStatus1.setServiceName(HDFS);
     componentStatus1.setMessage(DummyHostStatus);
     componentStatus1.setStatus(State.STARTED.name());
@@ -910,7 +888,7 @@ public class HeartbeatProcessorTest {
     CommandReport cr1 = new CommandReport();
     cr1.setActionId(StageUtils.getActionId(requestId, stageId));
     cr1.setTaskId(1);
-    cr1.setClusterName(DummyCluster);
+    //cr1.setClusterName(DummyCluster);
     cr1.setServiceName(HDFS);
     cr1.setRole(DATANODE);
     cr1.setStatus(HostRoleStatus.COMPLETED.toString());
@@ -922,7 +900,7 @@ public class HeartbeatProcessorTest {
     CommandReport cr2 = new CommandReport();
     cr2.setActionId(StageUtils.getActionId(requestId, stageId));
     cr2.setTaskId(2);
-    cr2.setClusterName(DummyCluster);
+    //cr2.setClusterName(DummyCluster);
     cr2.setServiceName(HDFS);
     cr2.setRole(NAMENODE);
     cr2.setStatus(HostRoleStatus.COMPLETED.toString());
@@ -1004,7 +982,7 @@ public class HeartbeatProcessorTest {
     CommandReport cr = new CommandReport();
     cr.setActionId(StageUtils.getActionId(requestId, stageId));
     cr.setTaskId(1);
-    cr.setClusterName(DummyCluster);
+    //cr.setClusterName(DummyCluster);
     cr.setServiceName(HDFS);
     cr.setRole(DATANODE);
     cr.setStatus(HostRoleStatus.IN_PROGRESS.toString());
@@ -1025,7 +1003,7 @@ public class HeartbeatProcessorTest {
     CommandReport cr1 = new CommandReport();
     cr1.setActionId(StageUtils.getActionId(requestId, stageId));
     cr1.setTaskId(1);
-    cr1.setClusterName(DummyCluster);
+    //cr1.setClusterName(DummyCluster);
     cr1.setServiceName(HDFS);
     cr1.setRole(DATANODE);
     cr1.setRoleCommand("INSTALL");
@@ -1037,7 +1015,7 @@ public class HeartbeatProcessorTest {
     CommandReport cr2 = new CommandReport();
     cr2.setActionId(StageUtils.getActionId(requestId, stageId));
     cr2.setTaskId(2);
-    cr2.setClusterName(DummyCluster);
+    //cr2.setClusterName(DummyCluster);
     cr2.setServiceName(HDFS);
     cr2.setRole(NAMENODE);
     cr2.setRoleCommand("INSTALL");
@@ -1114,7 +1092,7 @@ public class HeartbeatProcessorTest {
     CommandReport cr1 = new CommandReport();
     cr1.setActionId(StageUtils.getActionId(requestId, stageId));
     cr1.setTaskId(1);
-    cr1.setClusterName(DummyCluster);
+    //cr1.setClusterName(DummyCluster);
     cr1.setServiceName(HDFS);
     cr1.setRole(DATANODE);
     cr1.setRoleCommand("INSTALL");
@@ -1126,7 +1104,7 @@ public class HeartbeatProcessorTest {
     CommandReport cr2 = new CommandReport();
     cr2.setActionId(StageUtils.getActionId(requestId, stageId));
     cr2.setTaskId(2);
-    cr2.setClusterName(DummyCluster);
+    //cr2.setClusterName(DummyCluster);
     cr2.setServiceName(HDFS);
     cr2.setRole(NAMENODE);
     cr2.setRoleCommand("INSTALL");
@@ -1203,7 +1181,7 @@ public class HeartbeatProcessorTest {
     ExecutionCommand execCmd = new ExecutionCommand();
     execCmd.setRequestAndStage(2, 34);
     execCmd.setHostname(DummyHostname1);
-    aq.enqueue(DummyHostname1, new ExecutionCommand());
+    //aq.enqueue(DummyHostname1, new ExecutionCommand());
 
     HeartBeat hb = new HeartBeat();
     HostStatus hs = new HostStatus(HostStatus.Status.HEALTHY, DummyHostStatus);
@@ -1259,7 +1237,7 @@ public class HeartbeatProcessorTest {
     cmdReport.setRoleCommand(RoleCommand.ACTIONEXECUTE.name());
     cmdReport.setStatus(HostRoleStatus.COMPLETED.name());
     cmdReport.setRole("install_packages");
-    cmdReport.setClusterName(DummyCluster);
+    //cmdReport.setClusterName(DummyCluster);
 
     List<CommandReport> reports = new ArrayList<>();
     reports.add(cmdReport);
@@ -1319,7 +1297,7 @@ public class HeartbeatProcessorTest {
     ArrayList<ComponentStatus> componentStatuses = new ArrayList<>();
 
     ComponentStatus componentStatus1 = new ComponentStatus();
-    componentStatus1.setClusterName(DummyCluster);
+    //componentStatus1.setClusterName(DummyCluster);
     componentStatus1.setServiceName(HDFS);
     componentStatus1.setMessage(DummyHostStatus);
     componentStatus1.setStatus(State.INSTALLED.name());
@@ -1327,7 +1305,7 @@ public class HeartbeatProcessorTest {
     componentStatuses.add(componentStatus1);
 
     ComponentStatus componentStatus2 = new ComponentStatus();
-    componentStatus2.setClusterName(DummyCluster);
+    //componentStatus2.setClusterName(DummyCluster);
     componentStatus2.setServiceName(HDFS);
     componentStatus2.setMessage(DummyHostStatus);
     componentStatus2.setStatus(State.INSTALLED.name());

http://git-wip-us.apache.org/repos/asf/ambari/blob/44c1cb51/ambari-server/src/test/java/org/apache/ambari/server/agent/TestActionQueue.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/agent/TestActionQueue.java b/ambari-server/src/test/java/org/apache/ambari/server/agent/TestActionQueue.java
index 700c472..91ae1a8 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/agent/TestActionQueue.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/agent/TestActionQueue.java
@@ -27,7 +27,6 @@ import java.util.HashSet;
 import java.util.List;
 
 import org.apache.ambari.server.agent.AgentCommand.AgentCommandType;
-import org.easymock.EasyMock;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -129,7 +128,7 @@ public class TestActionQueue {
       while (shouldRun) {
         int index = 0;
         for (String host: hosts) {
-          actionQueue.enqueue(host, new StatusCommand());
+          //actionQueue.enqueue(host, new StatusCommand());
           opCounts[index]++;
           index++;
         }
@@ -339,7 +338,7 @@ public class TestActionQueue {
     String c6401 = "c6401.ambari.apache.org";
     String c6402 = "c6402.ambari.apache.org";
 
-    queue.enqueue(c6401,
+    /*queue.enqueue(c6401,
         EasyMock.createMockBuilder(ExecutionCommand.class).createNiceMock());
 
     queue.enqueue(c6401,
@@ -367,7 +366,7 @@ public class TestActionQueue {
         EasyMock.createMockBuilder(StatusCommand.class).createNiceMock());
 
     queue.enqueue(c6402,
-        EasyMock.createMockBuilder(AlertDefinitionCommand.class).createNiceMock());
+        EasyMock.createMockBuilder(AlertDefinitionCommand.class).createNiceMock());*/
 
     assertEquals(7, queue.size(c6401));
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/44c1cb51/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatHandler.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatHandler.java b/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatHandler.java
index 909bf69..5581c5b 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatHandler.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatHandler.java
@@ -207,7 +207,7 @@ public class TestHeartbeatHandler {
     execCmd.setHostname(hostname);
     execCmd.setClusterName(cluster.getClusterName());
     execCmd.setServiceName(HDFS);
-    aq.enqueue(hostname, execCmd);
+    //aq.enqueue(hostname, execCmd);
     HeartBeat hb = new HeartBeat();
     hb.setResponseId(0);
     HostStatus hs = new HostStatus(Status.HEALTHY, DummyHostStatus);
@@ -312,7 +312,7 @@ public class TestHeartbeatHandler {
     ArrayList<ComponentStatus> componentStatuses = new ArrayList<>();
 
     ComponentStatus componentStatus1 = new ComponentStatus();
-    componentStatus1.setClusterName(DummyCluster);
+    //componentStatus1.setClusterName(DummyCluster);
     componentStatus1.setServiceName(HDFS);
     componentStatus1.setMessage(DummyHostStatus);
     componentStatus1.setStatus(State.STARTED.name());
@@ -320,7 +320,7 @@ public class TestHeartbeatHandler {
     componentStatuses.add(componentStatus1);
 
     ComponentStatus componentStatus2 = new ComponentStatus();
-    componentStatus2.setClusterName(DummyCluster);
+    //componentStatus2.setClusterName(DummyCluster);
     componentStatus2.setServiceName(HDFS);
     componentStatus2.setMessage(DummyHostStatus);
     componentStatus2.setStatus(State.INSTALLED.name());
@@ -438,7 +438,6 @@ public class TestHeartbeatHandler {
     hb.setResponseId(0);
     hb.setHostname(DummyHostname1);
     hb.setNodeStatus(new HostStatus(Status.HEALTHY, DummyHostStatus));
-    hb.setRecoveryTimestamp(rc.getRecoveryTimestamp());
 
     HeartBeatResponse hbr = handler.handleHeartBeat(hb);
     assertNull(hbr.getRecoveryConfig());
@@ -816,7 +815,7 @@ public class TestHeartbeatHandler {
     CommandReport cr = new CommandReport();
     cr.setActionId(StageUtils.getActionId(requestId, stageId));
     cr.setTaskId(1);
-    cr.setClusterName(DummyCluster);
+    //cr.setClusterName(DummyCluster);
     cr.setServiceName(HDFS);
     cr.setRole(DATANODE);
     cr.setRoleCommand("INSTALL");
@@ -886,7 +885,7 @@ public class TestHeartbeatHandler {
     CommandReport cr = new CommandReport();
     cr.setActionId(StageUtils.getActionId(1, 1));
     cr.setTaskId(1);
-    cr.setClusterName(DummyCluster);
+    //cr.setClusterName(DummyCluster);
     cr.setServiceName(HDFS);
     cr.setRole(DATANODE);
     cr.setRoleCommand("INSTALL");
@@ -1030,7 +1029,7 @@ public class TestHeartbeatHandler {
 
     hostObject.setState(HostState.UNHEALTHY);
 
-    aq.enqueue(DummyHostname1, new StatusCommand());
+    //aq.enqueue(DummyHostname1, new StatusCommand());
 
     //All components are up
     HeartBeat hb1 = new HeartBeat();
@@ -1113,7 +1112,7 @@ public class TestHeartbeatHandler {
 
     hostObject.setState(HostState.UNHEALTHY);
 
-    aq.enqueue(DummyHostname1, new StatusCommand());
+    //aq.enqueue(DummyHostname1, new StatusCommand());
 
     //All components are up
     HeartBeat hb1 = new HeartBeat();
@@ -1122,13 +1121,13 @@ public class TestHeartbeatHandler {
     hb1.setHostname(DummyHostname1);
     List<ComponentStatus> componentStatus = new ArrayList<>();
     ComponentStatus dataNodeStatus = new ComponentStatus();
-    dataNodeStatus.setClusterName(cluster.getClusterName());
+    //dataNodeStatus.setClusterName(cluster.getClusterName());
     dataNodeStatus.setServiceName(HDFS);
     dataNodeStatus.setComponentName(DATANODE);
     dataNodeStatus.setStatus("STARTED");
     componentStatus.add(dataNodeStatus);
     ComponentStatus nameNodeStatus = new ComponentStatus();
-    nameNodeStatus.setClusterName(cluster.getClusterName());
+    //nameNodeStatus.setClusterName(cluster.getClusterName());
     nameNodeStatus.setServiceName(HDFS);
     nameNodeStatus.setComponentName(NAMENODE);
     nameNodeStatus.setStatus("STARTED");
@@ -1145,13 +1144,13 @@ public class TestHeartbeatHandler {
     hb2.setHostname(DummyHostname1);
     componentStatus = new ArrayList<>();
     dataNodeStatus = new ComponentStatus();
-    dataNodeStatus.setClusterName(cluster.getClusterName());
+    //dataNodeStatus.setClusterName(cluster.getClusterName());
     dataNodeStatus.setServiceName(HDFS);
     dataNodeStatus.setComponentName(DATANODE);
     dataNodeStatus.setStatus("INSTALLED");
     componentStatus.add(dataNodeStatus);
     nameNodeStatus = new ComponentStatus();
-    nameNodeStatus.setClusterName(cluster.getClusterName());
+    //nameNodeStatus.setClusterName(cluster.getClusterName());
     nameNodeStatus.setServiceName(HDFS);
     nameNodeStatus.setComponentName(NAMENODE);
     nameNodeStatus.setStatus("STARTED");
@@ -1170,13 +1169,13 @@ public class TestHeartbeatHandler {
     hb2a.setHostname(DummyHostname1);
     componentStatus = new ArrayList<>();
     dataNodeStatus = new ComponentStatus();
-    dataNodeStatus.setClusterName(cluster.getClusterName());
+    //dataNodeStatus.setClusterName(cluster.getClusterName());
     dataNodeStatus.setServiceName(HDFS);
     dataNodeStatus.setComponentName(DATANODE);
     dataNodeStatus.setStatus("INSTALLED");
     componentStatus.add(dataNodeStatus);
     nameNodeStatus = new ComponentStatus();
-    nameNodeStatus.setClusterName(cluster.getClusterName());
+    //nameNodeStatus.setClusterName(cluster.getClusterName());
     nameNodeStatus.setServiceName(HDFS);
     nameNodeStatus.setComponentName(NAMENODE);
     nameNodeStatus.setStatus("STARTED");
@@ -1196,13 +1195,13 @@ public class TestHeartbeatHandler {
     hb3.setHostname(DummyHostname1);
     componentStatus = new ArrayList<>();
     dataNodeStatus = new ComponentStatus();
-    dataNodeStatus.setClusterName(cluster.getClusterName());
+    //dataNodeStatus.setClusterName(cluster.getClusterName());
     dataNodeStatus.setServiceName(HDFS);
     dataNodeStatus.setComponentName(DATANODE);
     dataNodeStatus.setStatus("INSTALLED");
     componentStatus.add(dataNodeStatus);
     nameNodeStatus = new ComponentStatus();
-    nameNodeStatus.setClusterName(cluster.getClusterName());
+    //nameNodeStatus.setClusterName(cluster.getClusterName());
     nameNodeStatus.setServiceName(HDFS);
     nameNodeStatus.setComponentName(NAMENODE);
     nameNodeStatus.setStatus("INSTALLED");
@@ -1233,7 +1232,7 @@ public class TestHeartbeatHandler {
     hb4.setHostname(DummyHostname1);
     componentStatus = new ArrayList<>();
     dataNodeStatus = new ComponentStatus();
-    dataNodeStatus.setClusterName(cluster.getClusterName());
+    //dataNodeStatus.setClusterName(cluster.getClusterName());
     dataNodeStatus.setServiceName(HDFS);
     dataNodeStatus.setComponentName(DATANODE);
     dataNodeStatus.setStatus("STARTED");
@@ -1263,7 +1262,7 @@ public class TestHeartbeatHandler {
     cr1.setStdOut("");
     cr1.setExitCode(215);
     cr1.setRoleCommand("STOP");
-    cr1.setClusterName(DummyCluster);
+    //cr1.setClusterName(DummyCluster);
     ArrayList<CommandReport> reports = new ArrayList<>();
     reports.add(cr1);
     hb5.setReports(reports);
@@ -1278,7 +1277,7 @@ public class TestHeartbeatHandler {
     CommandReport cr1 = new CommandReport();
     cr1.setActionId(StageUtils.getActionId(requestId, stageId));
     cr1.setTaskId(1);
-    cr1.setClusterName(DummyCluster);
+    //cr1.setClusterName(DummyCluster);
     cr1.setServiceName(HDFS);
     cr1.setRole(NAMENODE);
     cr1.setStatus(HostRoleStatus.FAILED.toString());
@@ -1289,7 +1288,7 @@ public class TestHeartbeatHandler {
     CommandReport cr2 = new CommandReport();
     cr2.setActionId(StageUtils.getActionId(requestId, stageId));
     cr2.setTaskId(2);
-    cr2.setClusterName(DummyCluster);
+    //cr2.setClusterName(DummyCluster);
     cr2.setServiceName(HDFS);
     cr2.setRole(NAMENODE);
     cr2.setStatus(HostRoleStatus.FAILED.toString());
@@ -1390,7 +1389,7 @@ public class TestHeartbeatHandler {
                                                 State state, SecurityState securityState,
                                                 String componentName, String stackVersion) {
     ComponentStatus componentStatus1 = new ComponentStatus();
-    componentStatus1.setClusterName(clusterName);
+    //componentStatus1.setClusterName(clusterName);
     componentStatus1.setServiceName(serviceName);
     componentStatus1.setMessage(message);
     componentStatus1.setStatus(state.name());
@@ -1418,7 +1417,7 @@ public class TestHeartbeatHandler {
 
     ArrayList<ComponentStatus> componentStatuses = new ArrayList<>();
     ComponentStatus componentStatus1 = new ComponentStatus();
-    componentStatus1.setClusterName(DummyCluster);
+    //componentStatus1.setClusterName(DummyCluster);
     componentStatus1.setServiceName(HDFS);
     componentStatus1.setMessage(DummyHostStatus);
     componentStatus1.setStatus(State.STARTED.name());
@@ -1524,7 +1523,7 @@ public class TestHeartbeatHandler {
         }});
     replay(am);
 
-    heartbeatTestHelper.getHeartBeatHandler(am, aq).injectKeytab(executionCommand, "SET_KEYTAB", targetHost);
+    //heartbeatTestHelper.getHeartBeatHandler(am, aq).injectKeytab(executionCommand, "SET_KEYTAB", targetHost);
 
     return executionCommand.getKerberosCommandParams();
   }
@@ -1555,7 +1554,7 @@ public class TestHeartbeatHandler {
         }});
     replay(am);
 
-    heartbeatTestHelper.getHeartBeatHandler(am, aq).injectKeytab(executionCommand, "REMOVE_KEYTAB", targetHost);
+    //heartbeatTestHelper.getHeartBeatHandler(am, aq).injectKeytab(executionCommand, "REMOVE_KEYTAB", targetHost);
 
     return executionCommand.getKerberosCommandParams();
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/44c1cb51/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatMonitor.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatMonitor.java b/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatMonitor.java
index caf64be..0e38da5 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatMonitor.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatMonitor.java
@@ -20,10 +20,7 @@ package org.apache.ambari.server.agent;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.atLeast;
 import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
 
 import java.sql.SQLException;
 import java.util.Collections;
@@ -131,7 +128,7 @@ public class TestHeartbeatMonitor {
     hb.setResponseId(12);
     handler.handleHeartBeat(hb);
     hm.start();
-    aq.enqueue(hostname, new ExecutionCommand());
+    //aq.enqueue(hostname, new ExecutionCommand());
     //Heartbeat will expire and action queue will be flushed
     while (aq.size(hostname) != 0) {
       Thread.sleep(1);
@@ -414,7 +411,7 @@ public class TestHeartbeatMonitor {
         fail("HeartbeatMonitor should be already stopped");
       }
     }
-    verify(aqMock, atLeast(2)).enqueue(eq(hostname1), commandCaptor.capture());  // After registration and by HeartbeatMonitor
+    //verify(aqMock, atLeast(2)).enqueue(eq(hostname1), commandCaptor.capture());  // After registration and by HeartbeatMonitor
 
     List<AgentCommand> cmds = commandCaptor.getAllValues();
     assertTrue("HeartbeatMonitor should generate StatusCommands for host1", cmds.size() >= 2);
@@ -512,7 +509,7 @@ public class TestHeartbeatMonitor {
     handler.handleHeartBeat(hb);
 
     hm.start();
-    aq.enqueue(hostname1, new ExecutionCommand());
+    //aq.enqueue(hostname1, new ExecutionCommand());
     //Heartbeat will expire and action queue will be flushed
     while (aq.size(hostname1) != 0) {
       Thread.sleep(1);

http://git-wip-us.apache.org/repos/asf/ambari/blob/44c1cb51/ambari-server/src/test/java/org/apache/ambari/server/configuration/RecoveryConfigHelperTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/configuration/RecoveryConfigHelperTest.java b/ambari-server/src/test/java/org/apache/ambari/server/configuration/RecoveryConfigHelperTest.java
index e9a087a..a35957a 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/configuration/RecoveryConfigHelperTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/configuration/RecoveryConfigHelperTest.java
@@ -148,12 +148,6 @@ public class RecoveryConfigHelperTest {
     hdfs.addServiceComponent(NAMENODE).setRecoveryEnabled(true);
     hdfs.getServiceComponent(NAMENODE).addServiceComponentHost(DummyHostname1);
 
-    // Verify that the config is stale now
-    boolean isConfigStale = recoveryConfigHelper.isConfigStale(cluster.getClusterName(), DummyHostname1,
-            recoveryConfig.getRecoveryTimestamp());
-
-    assertTrue(isConfigStale);
-
     // Verify the new config
     recoveryConfig = recoveryConfigHelper.getRecoveryConfig(cluster.getClusterName(), DummyHostname1);
     assertEquals(recoveryConfig.getEnabledComponents(), "DATANODE,NAMENODE");
@@ -183,12 +177,6 @@ public class RecoveryConfigHelperTest {
     // Uninstall HDFS::DATANODE from host1
     hdfs.getServiceComponent(DATANODE).getServiceComponentHost(DummyHostname1).delete(new DeleteHostComponentStatusMetaData());
 
-    // Verify that the config is stale
-    boolean isConfigStale = recoveryConfigHelper.isConfigStale(cluster.getClusterName(), DummyHostname1,
-            recoveryConfig.getRecoveryTimestamp());
-
-    assertTrue(isConfigStale);
-
     // Verify the new config
     recoveryConfig = recoveryConfigHelper.getRecoveryConfig(cluster.getClusterName(), DummyHostname1);
     assertEquals(recoveryConfig.getEnabledComponents(), "NAMENODE");
@@ -221,12 +209,6 @@ public class RecoveryConfigHelperTest {
     }});
     config.save();
 
-    // Recovery config should be stale because of the above change.
-    boolean isConfigStale = recoveryConfigHelper.isConfigStale(cluster.getClusterName(), DummyHostname1,
-            recoveryConfig.getRecoveryTimestamp());
-
-    assertTrue(isConfigStale);
-
     // Get the recovery configuration again and verify that there are no components to be auto started
     recoveryConfig = recoveryConfigHelper.getRecoveryConfig(cluster.getClusterName(), DummyHostname1);
     assertNull(recoveryConfig.getEnabledComponents());
@@ -256,12 +238,6 @@ public class RecoveryConfigHelperTest {
 
     hdfs.getServiceComponent(DATANODE).getServiceComponentHost(DummyHostname1).setMaintenanceState(MaintenanceState.ON);
 
-    // We need a new config
-    boolean isConfigStale = recoveryConfigHelper.isConfigStale(cluster.getClusterName(), DummyHostname1,
-            recoveryConfig.getRecoveryTimestamp());
-
-    assertTrue(isConfigStale);
-
     // Only NAMENODE is left
     recoveryConfig = recoveryConfigHelper.getRecoveryConfig(cluster.getClusterName(), DummyHostname1);
     assertEquals(recoveryConfig.getEnabledComponents(), "NAMENODE");
@@ -288,12 +264,6 @@ public class RecoveryConfigHelperTest {
     // Turn off auto start for HDFS::DATANODE
     hdfs.getServiceComponent(DATANODE).setRecoveryEnabled(false);
 
-    // Config should be stale now
-    boolean isConfigStale = recoveryConfigHelper.isConfigStale(cluster.getClusterName(), DummyHostname1,
-            recoveryConfig.getRecoveryTimestamp());
-
-    assertTrue(isConfigStale);
-
     // Get the latest config. DATANODE should not be present.
     recoveryConfig = recoveryConfigHelper.getRecoveryConfig(cluster.getClusterName(), DummyHostname1);
     assertEquals(recoveryConfig.getEnabledComponents(), "");

http://git-wip-us.apache.org/repos/asf/ambari/blob/44c1cb51/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java
index c6ee875..2f8f268 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java
@@ -42,7 +42,6 @@ import org.apache.ambari.server.actionmanager.HostRoleStatus;
 import org.apache.ambari.server.agent.CommandReport;
 import org.apache.ambari.server.agent.ExecutionCommand;
 import org.apache.ambari.server.api.services.AmbariMetaInfo;
-import org.apache.ambari.server.controller.AmbariCustomCommandExecutionHelper;
 import org.apache.ambari.server.controller.AmbariManagementController;
 import org.apache.ambari.server.controller.AmbariServer;
 import org.apache.ambari.server.controller.ServiceConfigVersionResponse;
@@ -606,13 +605,13 @@ public class UpgradeActionTest {
     createUpgradeClusterTargetRepo(targetStack, targetRepo, hostName);
 
     // Verify the repo before calling Finalize
-    AmbariCustomCommandExecutionHelper helper = m_injector.getInstance(AmbariCustomCommandExecutionHelper.class);
+    AmbariMetaInfo ambariMetaInfo = m_injector.getInstance(AmbariMetaInfo.class);
     Host host = clusters.getHost("h1");
     Cluster cluster = clusters.getCluster(clusterName);
 
     RepositoryInfo repo = ambariMetaInfo.getRepository(sourceStack.getStackName(), sourceStack.getStackVersion(), "redhat6", sourceStack.getStackId());
     assertEquals(HDP_211_CENTOS6_REPO_URL, repo.getBaseUrl());
-    verifyBaseRepoURL(helper, cluster, host, HDP_211_CENTOS6_REPO_URL);
+    verifyBaseRepoURL(ambariMetaInfo, cluster, host, HDP_211_CENTOS6_REPO_URL);
 
     // Finalize the upgrade
     Map<String, String> commandParams = new HashMap<>();
@@ -634,7 +633,7 @@ public class UpgradeActionTest {
     assertEquals(HostRoleStatus.COMPLETED.name(), report.getStatus());
 
     // Verify the metainfo url
-    verifyBaseRepoURL(helper, cluster, host, "http://foo1");
+    verifyBaseRepoURL(ambariMetaInfo, cluster, host, "http://foo1");
   }
 
   /**
@@ -669,14 +668,14 @@ public class UpgradeActionTest {
     }
 
     // Verify the repo before calling Finalize
-    AmbariCustomCommandExecutionHelper helper = m_injector.getInstance(AmbariCustomCommandExecutionHelper.class);
+    AmbariMetaInfo ambariMetaInfo = m_injector.getInstance(AmbariMetaInfo.class);
     Host host = clusters.getHost("h1");
     Cluster cluster = clusters.getCluster(clusterName);
 
     RepositoryInfo repo = ambariMetaInfo.getRepository(sourceStack.getStackName(),
             sourceStack.getStackVersion(), "redhat6", sourceStack.getStackId());
     assertEquals(HDP_211_CENTOS6_REPO_URL, repo.getBaseUrl());
-    verifyBaseRepoURL(helper, cluster, host, HDP_211_CENTOS6_REPO_URL);
+    verifyBaseRepoURL(ambariMetaInfo, cluster, host, HDP_211_CENTOS6_REPO_URL);
 
     // Finalize the upgrade
     Map<String, String> commandParams = new HashMap<>();
@@ -698,8 +697,8 @@ public class UpgradeActionTest {
     assertEquals(HostRoleStatus.COMPLETED.name(), report.getStatus());
   }
 
-  private void verifyBaseRepoURL(AmbariCustomCommandExecutionHelper helper, Cluster cluster, Host host, String expectedRepoBaseURL) throws AmbariException {
-    String repoInfo = helper.getRepoInfo(cluster, host);
+  private void verifyBaseRepoURL(AmbariMetaInfo ambariMetaInfo, Cluster cluster, Host host, String expectedRepoBaseURL) throws AmbariException {
+    String repoInfo = ambariMetaInfo.getRepoInfoString(cluster, host);
     Gson gson = new Gson();
     JsonElement element = gson.fromJson(repoInfo, JsonElement.class);
     assertTrue(element.isJsonArray());
@@ -949,7 +948,7 @@ public class UpgradeActionTest {
     createUpgradeClusterAndSourceRepo(sourceStack, sourceRepo, hostName);
 
     // Verify the repo before calling Finalize
-    AmbariCustomCommandExecutionHelper helper = m_injector.getInstance(AmbariCustomCommandExecutionHelper.class);
+    AmbariMetaInfo ambariMetaInfo = m_injector.getInstance(AmbariMetaInfo.class);
     Host host = clusters.getHost("h1");
     Cluster cluster = clusters.getCluster(clusterName);
 
@@ -996,7 +995,7 @@ public class UpgradeActionTest {
 
     RepositoryInfo repo = ambariMetaInfo.getRepository(sourceStack.getStackName(), sourceStack.getStackVersion(), "redhat6", sourceStack.getStackId());
     assertEquals(HDP_211_CENTOS6_REPO_URL, repo.getBaseUrl());
-    verifyBaseRepoURL(helper, cluster, host, HDP_211_CENTOS6_REPO_URL);
+    verifyBaseRepoURL(ambariMetaInfo, cluster, host, HDP_211_CENTOS6_REPO_URL);
 
     // Finalize the upgrade, passing in the request ID so that history is
     // created
@@ -1020,7 +1019,7 @@ public class UpgradeActionTest {
     assertEquals(HostRoleStatus.COMPLETED.name(), report.getStatus());
 
     // Verify the metainfo url
-    verifyBaseRepoURL(helper, cluster, host, "http://foo1");
+    verifyBaseRepoURL(ambariMetaInfo, cluster, host, "http://foo1");
 
     // ensure that history now exists
     historyEntites = serviceComponentDesiredStateDAO.findHistory(cluster.getClusterId(),

http://git-wip-us.apache.org/repos/asf/ambari/blob/44c1cb51/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionHashTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionHashTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionHashTest.java
index 838cd6b..56faff6 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionHashTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionHashTest.java
@@ -387,9 +387,9 @@ public class AlertDefinitionHashTest extends TestCase {
     AlertExecutionCommand executionCommand = new AlertExecutionCommand(
         CLUSTERNAME, HOSTNAME, null);
 
-    actionQueue.enqueue(HOSTNAME, definitionCommand1);
+    /*actionQueue.enqueue(HOSTNAME, definitionCommand1);
     actionQueue.enqueue(HOSTNAME, executionCommand);
-    actionQueue.enqueue("anotherHost", definitionCommand2);
+    actionQueue.enqueue("anotherHost", definitionCommand2);*/
 
     assertEquals(2, actionQueue.size(HOSTNAME));
     assertEquals(1, actionQueue.size("anotherHost"));


Mime
View raw message