Repository: ambari Updated Branches: refs/heads/branch-2.2 227ead0c7 -> 16cda7576
Revert "AMBARI-15160. YARN restart icon appeared after 5 minutes after reconfig (aonishuk)" This reverts commit 5edef8a68c41fedaee171f40afd0fe204890aca5. Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/16cda757 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/16cda757 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/16cda757 Branch: refs/heads/branch-2.2 Commit: 16cda7576e6c0ae750a314aae4ec40ecbc370042 Parents: 227ead0 Author: Sumit Mohanty <[email protected]> Authored: Mon Feb 29 05:50:32 2016 -0800 Committer: Sumit Mohanty <[email protected]> Committed: Mon Feb 29 05:50:32 2016 -0800 ---------------------------------------------------------------------- .../ambari/server/state/ConfigHelper.java | 43 +------------------- .../ambari/server/state/ConfigHelperTest.java | 2 +- 2 files changed, 3 insertions(+), 42 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/16cda757/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 30e4157..aa30b48 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 @@ -19,8 +19,6 @@ package org.apache.ambari.server.state; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; -import com.google.common.cache.RemovalListener; -import com.google.common.cache.RemovalNotification; import com.google.common.collect.Maps; import com.google.inject.Inject; import com.google.inject.Singleton; @@ -35,7 +33,6 @@ import org.apache.ambari.server.orm.entities.ClusterConfigEntity; import org.apache.ambari.server.state.PropertyInfo.PropertyType; import org.apache.ambari.server.state.configgroup.ConfigGroup; import org.apache.ambari.server.upgrade.UpgradeCatalog170; -import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -86,30 +83,6 @@ public class ConfigHelper { public static final String HTTP_ONLY = "HTTP_ONLY"; public static final String HTTPS_ONLY = "HTTPS_ONLY"; - /** - * Used to debug stale config cache changes. - */ - private class StaleConfigRemovalListener implements RemovalListener { - - @Override - public void onRemoval(RemovalNotification removalNotification) { - ServiceComponentHost sch; - if(removalNotification.getKey() instanceof ServiceComponentHost) - { - sch = (ServiceComponentHost)removalNotification.getKey(); - } else { - return; - } - String message = String.format( - "Removed stale config flag for:\n\thost:component=%s:%s\n\treason=%s", - sch.getHostName(), - sch.getServiceComponentName(), - removalNotification.getCause().toString() - ); - LOG.info(message); - } - } - @Inject public ConfigHelper(Clusters c, AmbariMetaInfo metaInfo, Configuration configuration, ClusterDAO clusterDAO) { clusters = c; @@ -117,8 +90,7 @@ public class ConfigHelper { this.clusterDAO = clusterDAO; STALE_CONFIGS_CACHE_ENABLED = configuration.isStaleConfigCacheEnabled(); staleConfigsCache = CacheBuilder.newBuilder(). - expireAfterWrite(STALE_CONFIGS_CACHE_EXPIRATION_TIME, TimeUnit.SECONDS). - removalListener(new StaleConfigRemovalListener()).build(); + expireAfterWrite(STALE_CONFIGS_CACHE_EXPIRATION_TIME, TimeUnit.SECONDS).build(); } /** @@ -1005,17 +977,6 @@ public class ConfigHelper { Map<String, Map<String, String>> desired = getEffectiveDesiredTags(cluster, sch.getHostName()); - ArrayList<String> configs = new ArrayList<>(); - Iterator<Entry<String, Map<String, String>>> configIterator = desired.entrySet().iterator(); - while (configIterator.hasNext()) { - Entry<String, Map<String, String>> desiredEntry = configIterator.next(); - configs.add(desiredEntry.getKey() + ":" + desiredEntry.getValue()); - } - LOG.info(String.format( - "Calculating stale configs for \n\tcomponent:%s\n\twith configs:%s", - sch.getHostName() + ":" + sch.getServiceComponentName(), - StringUtils.join(configs, ';'))); - ServiceInfo serviceInfo = ambariMetaInfo.getService(stackId.getStackName(), stackId.getStackVersion(), sch.getServiceName()); ComponentInfo componentInfo = serviceInfo.getComponentByName(sch.getServiceComponentName()); @@ -1218,4 +1179,4 @@ public class ConfigHelper { } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ambari/blob/16cda757/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java index eaf35f5..4c9bd2e 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java @@ -661,7 +661,7 @@ public class ConfigHelperTest { // set up mocks ServiceComponentHost sch = createNiceMock(ServiceComponentHost.class); // set up expectations - expect(sch.getActualConfigs()).andReturn(schReturn).anyTimes(); + expect(sch.getActualConfigs()).andReturn(schReturn).times(6); expect(sch.getHostName()).andReturn("h1").anyTimes(); expect(sch.getClusterId()).andReturn(1l).anyTimes(); expect(sch.getServiceName()).andReturn("FLUME").anyTimes();
