ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smn...@apache.org
Subject ambari git commit: AMBARI-16806: AMS Collector is not automatically being configured for auto-start during blueprint deployment
Date Mon, 23 May 2016 17:43:35 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk b43edef52 -> 060c0237b


AMBARI-16806: AMS Collector is not automatically being configured for auto-start during blueprint
deployment


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

Branch: refs/heads/trunk
Commit: 060c0237b7ad51ff3b1426256d6b4aac63ba5ad1
Parents: b43edef
Author: Nahappan Somasundaram <nsomasundaram@hortonworks.com>
Authored: Sun May 22 18:47:57 2016 -0700
Committer: Nahappan Somasundaram <nsomasundaram@hortonworks.com>
Committed: Mon May 23 10:42:30 2016 -0700

----------------------------------------------------------------------
 .../internal/ComponentResourceProvider.java     |  5 ++++
 .../ambari/server/topology/AmbariContext.java   |  2 +-
 .../ambari/server/topology/Blueprint.java       |  4 ++--
 .../ambari/server/topology/BlueprintImpl.java   | 25 ++++++++++++--------
 4 files changed, 23 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/060c0237/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java
index dd2b31b..cc13e39 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java
@@ -359,6 +359,7 @@ public class ComponentResourceProvider extends AbstractControllerResourceProvide
       if (StringUtils.isNotEmpty(request.getRecoveryEnabled())) {
         boolean recoveryEnabled = Boolean.parseBoolean(request.getRecoveryEnabled());
         sc.setRecoveryEnabled(recoveryEnabled);
+        LOG.info("Component: {}, recovery_enabled from request: {}", request.getComponentName(),
recoveryEnabled);
       } else {
         StackId stackId = s.getDesiredStackVersion();
         ComponentInfo componentInfo = ambariMetaInfo.getComponent(stackId.getStackName(),
@@ -368,6 +369,8 @@ public class ComponentResourceProvider extends AbstractControllerResourceProvide
                 stackId.toString() + ", Service=" + s.getName() + ", Component=" + request.getComponentName());
         }
         sc.setRecoveryEnabled(componentInfo.isRecoveryEnabled());
+        LOG.info("Component: {}, recovery_enabled from stack definition:{}", componentInfo.getName(),
+                componentInfo.isRecoveryEnabled());
       }
 
       s.addServiceComponent(sc);
@@ -548,6 +551,8 @@ public class ComponentResourceProvider extends AbstractControllerResourceProvide
 
         boolean newRecoveryEnabled = Boolean.parseBoolean(request.getRecoveryEnabled());
         boolean oldRecoveryEnabled = sc.isRecoveryEnabled();
+        LOG.info("Component: {}, oldRecoveryEnabled: {}, newRecoveryEnabled {}",
+                componentName, oldRecoveryEnabled, newRecoveryEnabled);
         if (newRecoveryEnabled != oldRecoveryEnabled) {
           if (newRecoveryEnabled) {
             recoveryEnabledComponents.add(sc);

http://git-wip-us.apache.org/repos/asf/ambari/blob/060c0237/ambari-server/src/main/java/org/apache/ambari/server/topology/AmbariContext.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/AmbariContext.java
b/ambari-server/src/main/java/org/apache/ambari/server/topology/AmbariContext.java
index e3b51c0..849c696 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/topology/AmbariContext.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/AmbariContext.java
@@ -196,7 +196,7 @@ public class AmbariContext {
     for (String service : services) {
       serviceRequests.add(new ServiceRequest(clusterName, service, null));
       for (String component : topology.getBlueprint().getComponents(service)) {
-        String recoveryEnabled = String.valueOf(topology.getBlueprint().isRecoveryEnabled(service,
component));
+        String recoveryEnabled = topology.getBlueprint().getRecoveryEnabled(service, component);
         componentRequests.add(new ServiceComponentRequest(clusterName, service, component,
null, recoveryEnabled));
       }
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/060c0237/ambari-server/src/main/java/org/apache/ambari/server/topology/Blueprint.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/Blueprint.java
b/ambari-server/src/main/java/org/apache/ambari/server/topology/Blueprint.java
index 2fc74de..0edbaea 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/topology/Blueprint.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/Blueprint.java
@@ -92,9 +92,9 @@ public interface Blueprint {
    * @param serviceName - Service name.
    * @param componentName - Component name.
    *
-   * @return True or false.
+   * @return null if value is not specified; true or false if specified.
    */
-  public boolean isRecoveryEnabled(String serviceName, String componentName);
+  public String getRecoveryEnabled(String serviceName, String componentName);
 
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/060c0237/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintImpl.java
b/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintImpl.java
index 0bb4874..aeb9a2d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintImpl.java
@@ -39,7 +39,6 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 
@@ -166,22 +165,24 @@ public class BlueprintImpl implements Blueprint {
    * @param serviceName - Service name.
    * @param componentName - Component name.
    *
-   * @return True or false.
+   * @return null if value is not specified; true or false if specified.
    */
   @Override
-  public boolean isRecoveryEnabled(String serviceName, String componentName) {
-    if (setting == null)
-      return false;
-
+  public String getRecoveryEnabled(String serviceName, String componentName) {
     Set<HashMap<String, String>> settingValue;
 
+    if (setting == null)
+      return null;
+
     // If component name was specified in the list of "component_settings",
     // determine if recovery_enabled is true or false and return it.
     settingValue = setting.getSettingValue(Setting.SETTING_NAME_COMPONENT_SETTINGS);
     for (Map<String, String> setting : settingValue) {
       String name = setting.get(Setting.SETTING_NAME_NAME);
       if (StringUtils.equals(name, componentName)) {
-        return Boolean.parseBoolean(setting.get(Setting.SETTING_NAME_RECOVERY_ENABLED));
+        if (!StringUtils.isEmpty(setting.get(Setting.SETTING_NAME_RECOVERY_ENABLED))) {
+          return setting.get(Setting.SETTING_NAME_RECOVERY_ENABLED);
+        }
       }
     }
 
@@ -190,17 +191,21 @@ public class BlueprintImpl implements Blueprint {
     for ( Map<String, String> setting : settingValue){
       String name = setting.get(Setting.SETTING_NAME_NAME);
       if (StringUtils.equals(name, serviceName)) {
-        return Boolean.parseBoolean(setting.get(Setting.SETTING_NAME_RECOVERY_ENABLED));
+        if (!StringUtils.isEmpty(setting.get(Setting.SETTING_NAME_RECOVERY_ENABLED))) {
+          return setting.get(Setting.SETTING_NAME_RECOVERY_ENABLED);
+        }
       }
     }
 
     // If service name is not specified, look up the cluster setting.
     settingValue = setting.getSettingValue(Setting.SETTING_NAME_RECOVERY_SETTINGS);
     for (Map<String, String> setting : settingValue) {
-      return Boolean.parseBoolean(setting.get(Setting.SETTING_NAME_RECOVERY_ENABLED));
+      if (!StringUtils.isEmpty(setting.get(Setting.SETTING_NAME_RECOVERY_ENABLED))) {
+        return setting.get(Setting.SETTING_NAME_RECOVERY_ENABLED);
+      }
     }
 
-    return false;
+    return null;
   }
 
   @Override


Mime
View raw message