Merge branch 'trunk' into branch-feature-AMBARI-18456

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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 532caef33fe65d6933e9797d3db12065555bd69b
Parents: 2c60082 7ed5259
Author: Jonathan Hurley <jhur...@hortonworks.com>
Authored: Tue Oct 18 15:32:08 2016 -0400
Committer: Jonathan Hurley <jhur...@hortonworks.com>
Committed: Tue Oct 18 15:32:08 2016 -0400

----------------------------------------------------------------------
 .../src/main/python/ambari_agent/ActionQueue.py |  26 +--
 .../main/python/ambari_commons/thread_utils.py  |  43 ++++
 ambari-server/src/main/assemblies/server.xml    |   4 +
 .../controller/ServiceComponentHostRequest.java |  10 +
 .../ServiceComponentHostResponse.java           |  19 +-
 .../internal/HostComponentResourceProvider.java |   9 +
 .../internal/JsonHttpPropertyRequest.java       |   6 +-
 .../controller/internal/URLStreamProvider.java  |   3 +
 .../internal/UpgradeResourceProvider.java       |   4 +-
 .../ambari/server/state/ConfigHelper.java       |  17 +-
 .../ambari/server/state/PropertyInfo.java       |  11 +
 .../state/PropertyStackUpgradeBehavior.java     |  57 +++++
 .../server/state/ServiceComponentHost.java      |   6 +
 .../svccomphost/ServiceComponentHostImpl.java   |  10 +-
 .../src/main/resources/APACHE-AMBARI-MIB.txt    | 206 ++++++++++++++++++
 .../src/main/resources/configuration-schema.xsd |   5 +
 .../src/main/resources/properties.json          |   1 +
 .../services/STORM/configuration/storm-site.xml |   1 +
 .../ClientConfigResourceProviderTest.java       |   6 +-
 .../HostComponentResourceProviderTest.java      |  10 +-
 .../internal/HostResourceProviderTest.java      |  26 +--
 .../StackUpgradeConfigurationMergeTest.java     |   4 +-
 .../internal/UpgradeResourceProviderTest.java   |   6 +-
 .../ambari/server/state/ConfigHelperTest.java   | 210 +++++++++++++------
 .../app/controllers/global/update_controller.js |   3 +-
 .../main/admin/stack_and_upgrade_controller.js  |  22 +-
 ambari-web/app/controllers/wizard.js            |  12 +-
 .../app/mappers/component_config_mapper.js      |   1 +
 ambari-web/app/mappers/hosts_mapper.js          |   2 +
 .../app/mappers/service_metrics_mapper.js       |   1 +
 ambari-web/app/mixins/common/serverValidator.js |  22 +-
 ambari-web/app/models/host_component.js         |   1 +
 ambari-web/app/styles/config_history_flow.less  |  31 ++-
 .../common/configs/config_history_flow.hbs      |  32 +--
 .../service/info/summary/master_components.hbs  |   2 +-
 ambari-web/app/utils/ajax/ajax.js               |   2 +-
 .../views/common/configs/config_history_flow.js |   3 +-
 ambari-web/pom.xml                              |  10 +-
 .../admin/stack_and_upgrade_controller_test.js  | 154 ++++++++++++--
 .../test/mixins/common/serverValidator_test.js  |  18 +-
 contrib/alert-snmp-mib/APACHE-AMBARI-MIB.txt    | 206 ------------------
 contrib/alert-snmp-mib/README.md                |   2 +-
 .../NIFI/1.0.0/package/scripts/params.py        |   2 +-
 .../resources/stacks/HDF/2.0/repos/repoinfo.xml |  20 +-
 44 files changed, 841 insertions(+), 405 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/532caef3/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/532caef3/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentHost.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/532caef3/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
----------------------------------------------------------------------
diff --cc 
ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
index 485329b,74eaa62..c1655aa
--- 
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
@@@ -1233,48 -1355,60 +1238,49 @@@ public class ServiceComponentHostImpl i
  
    @Override
    public ServiceComponentHostResponse convertToResponse(Map<String, 
DesiredConfig> desiredConfigs) {
 -    clusterGlobalLock.readLock().lock();
 -    try {
 -      readLock.lock();
 -      try {
 -        HostComponentStateEntity hostComponentStateEntity = getStateEntity();
 -        if (null == hostComponentStateEntity) {
 -          LOG.warn("Could not convert ServiceComponentHostResponse to a 
response. It's possible that Host " + getHostName() + " was deleted.");
 -          return null;
 -        }
 +    HostComponentStateEntity hostComponentStateEntity = getStateEntity();
 +    if (null == hostComponentStateEntity) {
 +      LOG.warn(
 +          "Could not convert ServiceComponentHostResponse to a response. It's 
possible that Host {} was deleted.",
 +          getHostName());
 +      return null;
 +    }
  
 -        String clusterName = serviceComponent.getClusterName();
 -        String serviceName = serviceComponent.getServiceName();
 -        String serviceComponentName = serviceComponent.getName();
 -        String hostName = getHostName();
 -        String publicHostName = getPublicHostName();
 -        String state = getState().toString();
 -        String stackId = getStackVersion().getStackId();
 -        String desiredState = getDesiredState().toString();
 -        String desiredStackId = getDesiredStackVersion().getStackId();
 -        HostComponentAdminState componentAdminState = 
getComponentAdminState();
 -        UpgradeState upgradeState = 
hostComponentStateEntity.getUpgradeState();
 -
 -        String displayName = null;
 -        try {
 -          ComponentInfo compInfo = 
ambariMetaInfo.getComponent(getStackVersion().getStackName(),
 -            getStackVersion().getStackVersion(), serviceName, 
serviceComponentName);
 -          displayName = compInfo.getDisplayName();
 -        } catch (AmbariException e) {
 -          displayName = serviceComponentName;
 -        }
 +    String clusterName = serviceComponent.getClusterName();
 +    String serviceName = serviceComponent.getServiceName();
 +    String serviceComponentName = serviceComponent.getName();
 +    String hostName = getHostName();
++    String publicHostName = getPublicHostName();
 +    String state = getState().toString();
 +    String stackId = getStackVersion().getStackId();
 +    String desiredState = getDesiredState().toString();
 +    String desiredStackId = getDesiredStackVersion().getStackId();
 +    HostComponentAdminState componentAdminState = getComponentAdminState();
 +    UpgradeState upgradeState = hostComponentStateEntity.getUpgradeState();
  
 -        ServiceComponentHostResponse r = new ServiceComponentHostResponse(
 -            clusterName, serviceName,
 -            serviceComponentName, displayName, hostName,
 -            publicHostName, state,
 -            stackId, desiredState,
 -            desiredStackId, componentAdminState);
 +    String displayName = null;
 +    try {
 +      ComponentInfo compInfo = 
ambariMetaInfo.getComponent(getStackVersion().getStackName(),
 +          getStackVersion().getStackVersion(), serviceName, 
serviceComponentName);
 +      displayName = compInfo.getDisplayName();
 +    } catch (AmbariException e) {
 +      displayName = serviceComponentName;
 +    }
  
 -        r.setActualConfigs(actualConfigs);
 -        r.setUpgradeState(upgradeState);
 +    ServiceComponentHostResponse r = new 
ServiceComponentHostResponse(clusterName, serviceName,
-         serviceComponentName, displayName, hostName, state, stackId, 
desiredState, desiredStackId,
-         componentAdminState);
++        serviceComponentName, displayName, hostName, publicHostName, state, 
stackId, 
++        desiredState, desiredStackId, componentAdminState);
  
 -        try {
 -          r.setStaleConfig(helper.isStaleConfigs(this, desiredConfigs));
 -        } catch (Exception e) {
 -          LOG.error("Could not determine stale config", e);
 -        }
 +    r.setActualConfigs(actualConfigs);
 +    r.setUpgradeState(upgradeState);
  
 -        return r;
 -      } finally {
 -        readLock.unlock();
 -      }
 -    } finally {
 -      clusterGlobalLock.readLock().unlock();
 +    try {
 +      r.setStaleConfig(helper.isStaleConfigs(this, desiredConfigs));
 +    } catch (Exception e) {
 +      LOG.error("Could not determine stale config", e);
      }
 +
 +    return r;
    }
  
    @Override

http://git-wip-us.apache.org/repos/asf/ambari/blob/532caef3/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/532caef3/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java
----------------------------------------------------------------------
diff --cc 
ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java
index a802a83,d014bde..d50c92d
--- 
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
@@@ -108,8 -116,13 +109,10 @@@ public class ConfigHelperTest 
        Assert.assertNotNull(cluster);
        clusters.addHost("h1");
        clusters.addHost("h2");
+       clusters.addHost("h3");
        Assert.assertNotNull(clusters.getHost("h1"));
        Assert.assertNotNull(clusters.getHost("h2"));
+       Assert.assertNotNull(clusters.getHost("h3"));
 -      clusters.getHost("h1").persist();
 -      clusters.getHost("h2").persist();
 -      clusters.getHost("h3").persist();
  
        // core-site
        ConfigurationRequest cr = new ConfigurationRequest();

Reply via email to