ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject git commit: AMBARI-6935. Stacks API should expose service level dependencies (aonishuk)
Date Wed, 20 Aug 2014 12:55:03 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk ed09f6a22 -> 84c4b434e


AMBARI-6935. Stacks API should expose service level dependencies (aonishuk)


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

Branch: refs/heads/trunk
Commit: 84c4b434e73fcd8667d2b9c5133be7d2ff4c4454
Parents: ed09f6a
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Wed Aug 20 15:54:55 2014 +0300
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Wed Aug 20 15:54:55 2014 +0300

----------------------------------------------------------------------
 .../server/api/util/StackExtensionHelper.java   |  7 ++++++
 .../server/controller/StackServiceResponse.java | 10 ++++++++
 .../internal/StackServiceResourceProvider.java  |  6 +++++
 .../apache/ambari/server/state/ServiceInfo.java | 11 ++++++++-
 .../src/main/resources/properties.json          |  1 +
 .../HDP/1.3.2/services/HBASE/metainfo.xml       |  5 ++++
 .../stacks/HDP/1.3.2/services/HIVE/metainfo.xml |  9 +++++++
 .../HDP/1.3.2/services/MAPREDUCE/metainfo.xml   |  4 ++++
 .../HDP/1.3.2/services/OOZIE/metainfo.xml       |  4 ++++
 .../stacks/HDP/1.3.2/services/PIG/metainfo.xml  |  4 ++++
 .../HDP/1.3.2/services/SQOOP/metainfo.xml       |  5 ++++
 .../HDP/1.3.2/services/WEBHCAT/metainfo.xml     |  6 +++++
 .../HDP/2.0.6/services/FLUME/metainfo.xml       |  4 ++++
 .../HDP/2.0.6/services/HBASE/metainfo.xml       |  5 ++++
 .../stacks/HDP/2.0.6/services/HDFS/metainfo.xml |  4 ++++
 .../stacks/HDP/2.0.6/services/HIVE/metainfo.xml | 11 +++++++++
 .../HDP/2.0.6/services/OOZIE/metainfo.xml       |  4 ++++
 .../stacks/HDP/2.0.6/services/PIG/metainfo.xml  |  4 ++++
 .../HDP/2.0.6/services/SQOOP/metainfo.xml       |  5 ++++
 .../HDP/2.0.6/services/WEBHCAT/metainfo.xml     |  6 +++++
 .../stacks/HDP/2.0.6/services/YARN/metainfo.xml |  9 +++++++
 .../stacks/HDP/2.1/services/FALCON/metainfo.xml |  4 ++++
 .../stacks/HDP/2.1/services/STORM/metainfo.xml  |  4 ++++
 .../stacks/HDP/2.1/services/TEZ/metainfo.xml    |  4 ++++
 .../api/util/StackExtensionHelperTest.java      | 25 ++++++++++++++++++++
 .../HDP/2.0.7/services/HBASE/metainfo.xml       |  4 ++++
 26 files changed, 164 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/84c4b434/ambari-server/src/main/java/org/apache/ambari/server/api/util/StackExtensionHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/util/StackExtensionHelper.java
b/ambari-server/src/main/java/org/apache/ambari/server/api/util/StackExtensionHelper.java
index 0670d9c..c62e48d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/util/StackExtensionHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/util/StackExtensionHelper.java
@@ -156,6 +156,13 @@ public class StackExtensionHelper {
           parentService.getExcludedConfigTypes() :
           Collections.<String>emptySet()
     );
+    mergedServiceInfo.setRequiredServices(
+        childService.getRequiredServices() != null ?
+          childService.getRequiredServices() :
+          parentService.getRequiredServices() != null ?
+            parentService.getRequiredServices() :
+            Collections.<String>emptyList()
+      );
     
     mergedServiceInfo.setRestartRequiredAfterChange(
             (childService.isRestartRequiredAfterChange() != null) 

http://git-wip-us.apache.org/repos/asf/ambari/blob/84c4b434/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceResponse.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceResponse.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceResponse.java
index 25b3b8d..6e7e8e0 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceResponse.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceResponse.java
@@ -38,6 +38,7 @@ public class StackServiceResponse {
   private List<String> customCommands;
 
   private Map<String, Map<String, Map<String, String>>> configTypes;
+  private List<String> requiredServices;
 
   /**
    * Constructor.
@@ -51,6 +52,7 @@ public class StackServiceResponse {
     comments = service.getComment();
     serviceVersion = service.getVersion();
     configTypes = service.getConfigTypes();
+    requiredServices = service.getRequiredServices();
     serviceCheckSupported = null != service.getCommandScript();
 
     // the custom command names defined at the service (not component) level
@@ -116,6 +118,14 @@ public class StackServiceResponse {
   public Map<String, Map<String, Map<String, String>>> getConfigTypes()
{
     return configTypes;
   }
+  
+  public List<String> getRequiredServices() {
+    return requiredServices;
+  }
+
+  public void setRequiredServices(List<String> requiredServices) {
+    this.requiredServices = requiredServices;
+  }
 
   /**
    * Gets whether the service represented by this response supports running

http://git-wip-us.apache.org/repos/asf/ambari/blob/84c4b434/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackServiceResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackServiceResourceProvider.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackServiceResourceProvider.java
index 0523edc..f6a6141 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackServiceResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackServiceResourceProvider.java
@@ -61,6 +61,9 @@ public class StackServiceResourceProvider extends ReadOnlyResourceProvider
{
 
   private static final String CONFIG_TYPES = PropertyHelper.getPropertyId(
       "StackServices", "config_types");
+  
+  private static final String REQUIRED_SERVICES_ID = PropertyHelper.getPropertyId(
+      "StackServices", "required_services");
 
   private static final String SERVICE_CHECK_SUPPORTED_PROPERTY_ID = PropertyHelper.getPropertyId(
       "StackServices", "service_check_supported");
@@ -127,6 +130,9 @@ public class StackServiceResourceProvider extends ReadOnlyResourceProvider
{
 
       setResourceProperty(resource, CONFIG_TYPES,
           response.getConfigTypes(), requestedIds);
+      
+      setResourceProperty(resource, REQUIRED_SERVICES_ID,
+          response.getRequiredServices(), requestedIds);
 
       setResourceProperty(resource, SERVICE_CHECK_SUPPORTED_PROPERTY_ID,
           response.isServiceCheckSupported(), requestedIds);

http://git-wip-us.apache.org/repos/asf/ambari/blob/84c4b434/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java
index ac1c9b5..fe2c5f3 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java
@@ -133,7 +133,10 @@ public class ServiceInfo {
   @XmlElementWrapper(name="customCommands")
   @XmlElements(@XmlElement(name="customCommand"))
   private List<CustomCommandDefinition> customCommands;
-
+  
+  @XmlElementWrapper(name="requiredServices")
+  @XmlElement(name="service")
+  private List<String> requiredServices;
 
   /**
    * Meaning: stores subpath from stack root to exact directory, that contains
@@ -175,7 +178,13 @@ public class ServiceInfo {
   public void setComment(String comment) {
     this.comment = comment;
   }
+  public List<String> getRequiredServices() {
+    return requiredServices;
+  }
 
+  public void setRequiredServices(List<String> requiredServices) {
+    this.requiredServices = requiredServices;
+  }
   public List<PropertyInfo> getProperties() {
     if (properties == null) properties = new ArrayList<PropertyInfo>();
     return properties;

http://git-wip-us.apache.org/repos/asf/ambari/blob/84c4b434/ambari-server/src/main/resources/properties.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/properties.json b/ambari-server/src/main/resources/properties.json
index aa2bf71..6686f39 100644
--- a/ambari-server/src/main/resources/properties.json
+++ b/ambari-server/src/main/resources/properties.json
@@ -229,6 +229,7 @@
         "StackServices/config_types",
         "StackServices/service_check_supported",
         "StackServices/custom_commands",
+        "StackServices/required_services",
         "_"
     ],
     "StackConfiguration":[

http://git-wip-us.apache.org/repos/asf/ambari/blob/84c4b434/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HBASE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HBASE/metainfo.xml
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HBASE/metainfo.xml
index d1e8795..fa53125 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HBASE/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HBASE/metainfo.xml
@@ -127,6 +127,11 @@
         <scriptType>PYTHON</scriptType>
         <timeout>300</timeout>
       </commandScript>
+      
+      <requiredServices>
+        <service>HDFS</service>
+        <service>ZOOKEEPER</service>
+      </requiredServices>
 
       <configuration-dependencies>
         <config-type>hbase-policy</config-type>

http://git-wip-us.apache.org/repos/asf/ambari/blob/84c4b434/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/metainfo.xml
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/metainfo.xml
index c1263d5..96e8aba 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/metainfo.xml
@@ -147,6 +147,11 @@
         <scriptType>PYTHON</scriptType>
         <timeout>300</timeout>
       </commandScript>
+      
+      <requiredServices>
+        <service>MAPREDUCE</service>
+        <service>ZOOKEEPER</service>
+      </requiredServices>
 
       <configuration-dependencies>
         <config-type>hive-site</config-type>
@@ -185,6 +190,10 @@
         <scriptType>PYTHON</scriptType>
         <timeout>300</timeout>
       </commandScript>
+      
+      <requiredServices>
+        <service>HIVE</service>
+      </requiredServices>
 
       <configuration-dependencies>
         <config-type>hive-site</config-type>

http://git-wip-us.apache.org/repos/asf/ambari/blob/84c4b434/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/MAPREDUCE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/MAPREDUCE/metainfo.xml
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/MAPREDUCE/metainfo.xml
index a900f2e..7ab788a 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/MAPREDUCE/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/MAPREDUCE/metainfo.xml
@@ -121,6 +121,10 @@
         <scriptType>PYTHON</scriptType>
         <timeout>300</timeout>
       </commandScript>
+      
+      <requiredServices>
+        <service>HDFS</service>
+      </requiredServices>
 
       <configuration-dependencies>
         <config-type>capacity-scheduler</config-type>

http://git-wip-us.apache.org/repos/asf/ambari/blob/84c4b434/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/metainfo.xml
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/metainfo.xml
index 4e83703..fb8397e 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/metainfo.xml
@@ -117,6 +117,10 @@
         <scriptType>PYTHON</scriptType>
         <timeout>300</timeout>
       </commandScript>
+      
+      <requiredServices>
+        <service>MAPREDUCE</service>
+      </requiredServices>
 
       <configuration-dependencies>
         <config-type>oozie-site</config-type>

http://git-wip-us.apache.org/repos/asf/ambari/blob/84c4b434/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/PIG/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/PIG/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/PIG/metainfo.xml
index e7f0cad..ee745e8 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/PIG/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/PIG/metainfo.xml
@@ -62,6 +62,10 @@
         <scriptType>PYTHON</scriptType>
         <timeout>300</timeout>
       </commandScript>
+      
+      <requiredServices>
+        <service>MAPREDUCE</service>
+      </requiredServices>
 
       <configuration-dependencies>
         <config-type>pig-env</config-type>

http://git-wip-us.apache.org/repos/asf/ambari/blob/84c4b434/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/SQOOP/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/SQOOP/metainfo.xml
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/SQOOP/metainfo.xml
index 1f835cb..1c25945 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/SQOOP/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/SQOOP/metainfo.xml
@@ -77,6 +77,11 @@
         <scriptType>PYTHON</scriptType>
         <timeout>300</timeout>
       </commandScript>
+      
+      <requiredServices>
+        <service>HDFS</service>
+      </requiredServices>
+      
       <configuration-dependencies>
         <config-type>sqoop-env</config-type>
       </configuration-dependencies>

http://git-wip-us.apache.org/repos/asf/ambari/blob/84c4b434/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/WEBHCAT/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/WEBHCAT/metainfo.xml
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/WEBHCAT/metainfo.xml
index 636f499..642f5d0 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/WEBHCAT/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/WEBHCAT/metainfo.xml
@@ -86,6 +86,12 @@
         <scriptType>PYTHON</scriptType>
         <timeout>300</timeout>
       </commandScript>
+      
+      <requiredServices>
+        <service>ZOOKEEPER</service>
+        <service>HIVE</service>
+      </requiredServices>
+      
       <configuration-dependencies>
         <config-type>webhcat-site</config-type>
         <config-type>webhcat-env</config-type>

http://git-wip-us.apache.org/repos/asf/ambari/blob/84c4b434/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/FLUME/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/FLUME/metainfo.xml
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/FLUME/metainfo.xml
index 4011c28..5b73548 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/FLUME/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/FLUME/metainfo.xml
@@ -51,6 +51,10 @@
         <scriptType>PYTHON</scriptType>
         <timeout>300</timeout>
       </commandScript>
+      
+      <requiredServices>
+        <service>HDFS</service>
+      </requiredServices>
 
       <configuration-dependencies>
         <config-type>flume-env</config-type>

http://git-wip-us.apache.org/repos/asf/ambari/blob/84c4b434/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/metainfo.xml
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/metainfo.xml
index c63b2b8..af6b100 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/metainfo.xml
@@ -117,6 +117,11 @@
         <scriptType>PYTHON</scriptType>
         <timeout>300</timeout>
       </commandScript>
+      
+      <requiredServices>
+        <service>ZOOKEEPER</service>
+        <service>HDFS</service>
+      </requiredServices>
 
       <configuration-dependencies>
         <config-type>hbase-policy</config-type>

http://git-wip-us.apache.org/repos/asf/ambari/blob/84c4b434/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/metainfo.xml
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/metainfo.xml
index 62b7cd8..53b9304 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/metainfo.xml
@@ -201,6 +201,10 @@
         <scriptType>PYTHON</scriptType>
         <timeout>300</timeout>
       </commandScript>
+      
+      <requiredServices>
+        <service>ZOOKEEPER</service>
+      </requiredServices>
 
       <configuration-dependencies>
         <config-type>core-site</config-type>

http://git-wip-us.apache.org/repos/asf/ambari/blob/84c4b434/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/metainfo.xml
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/metainfo.xml
index eecc292..985ca18 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/metainfo.xml
@@ -159,6 +159,12 @@
         <scriptType>PYTHON</scriptType>
         <timeout>300</timeout>
       </commandScript>
+      
+      <requiredServices>
+        <service>ZOOKEEPER</service>
+        <service>YARN</service>
+        <service>TEZ</service>
+      </requiredServices>
 
       <configuration-dependencies>
         <config-type>hive-site</config-type>
@@ -200,6 +206,11 @@
         <scriptType>PYTHON</scriptType>
         <timeout>300</timeout>
       </commandScript>
+      
+      <requiredServices>
+        <service>HIVE</service>
+      </requiredServices>
+      
       <configuration-dependencies>
         <config-type>hive-site</config-type>
         <config-type>hive-env</config-type>

http://git-wip-us.apache.org/repos/asf/ambari/blob/84c4b434/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/metainfo.xml
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/metainfo.xml
index bdc83ea..093d5d3 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/metainfo.xml
@@ -146,6 +146,10 @@
         <scriptType>PYTHON</scriptType>
         <timeout>300</timeout>
       </commandScript>
+      
+      <requiredServices>
+        <service>YARN</service>
+      </requiredServices>
 
       <configuration-dependencies>
         <config-type>oozie-site</config-type>

http://git-wip-us.apache.org/repos/asf/ambari/blob/84c4b434/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/PIG/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/PIG/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/PIG/metainfo.xml
index 48b42f1..fbd6173 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/PIG/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/PIG/metainfo.xml
@@ -75,6 +75,10 @@
           <dictionaryName>pig-env</dictionaryName>
         </configFile>
       </configFiles>
+      
+      <requiredServices>
+        <service>YARN</service>
+      </requiredServices>
 
       <configuration-dependencies>
         <config-type>pig-env</config-type>

http://git-wip-us.apache.org/repos/asf/ambari/blob/84c4b434/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/SQOOP/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/SQOOP/metainfo.xml
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/SQOOP/metainfo.xml
index 4573211..c8c01f1 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/SQOOP/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/SQOOP/metainfo.xml
@@ -77,6 +77,11 @@
         <scriptType>PYTHON</scriptType>
         <timeout>300</timeout>
       </commandScript>
+      
+      <requiredServices>
+        <service>HDFS</service>
+      </requiredServices>
+      
       <configuration-dependencies>
         <config-type>sqoop-env</config-type>
       </configuration-dependencies>

http://git-wip-us.apache.org/repos/asf/ambari/blob/84c4b434/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/WEBHCAT/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/WEBHCAT/metainfo.xml
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/WEBHCAT/metainfo.xml
index 325fddf..5e93cf4 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/WEBHCAT/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/WEBHCAT/metainfo.xml
@@ -93,6 +93,12 @@
         <scriptType>PYTHON</scriptType>
         <timeout>300</timeout>
       </commandScript>
+      
+      <requiredServices>
+        <service>HIVE</service>
+        <service>ZOOKEEPER</service>
+      </requiredServices>
+      
       <configuration-dependencies>
         <config-type>webhcat-site</config-type>
         <config-type>webhcat-env</config-type>

http://git-wip-us.apache.org/repos/asf/ambari/blob/84c4b434/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/metainfo.xml
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/metainfo.xml
index c2e995d..e08221a 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/metainfo.xml
@@ -126,6 +126,11 @@
         <scriptType>PYTHON</scriptType>
         <timeout>300</timeout>
       </commandScript>
+      
+      <requiredServices>
+        <service>HDFS</service>
+        <service>TEZ</service>
+      </requiredServices>
 
       <configuration-dependencies>
         <config-type>yarn-site</config-type>
@@ -210,6 +215,10 @@
         <scriptType>PYTHON</scriptType>
         <timeout>300</timeout>
       </commandScript>
+      
+      <requiredServices>
+        <service>YARN</service>
+      </requiredServices>
 
       <configuration-dir>configuration-mapred</configuration-dir>
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/84c4b434/ambari-server/src/main/resources/stacks/HDP/2.1/services/FALCON/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1/services/FALCON/metainfo.xml
b/ambari-server/src/main/resources/stacks/HDP/2.1/services/FALCON/metainfo.xml
index 43c2a3e..c16893e 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.1/services/FALCON/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.1/services/FALCON/metainfo.xml
@@ -84,6 +84,10 @@
         <scriptType>PYTHON</scriptType>
         <timeout>300</timeout>
       </commandScript>
+      
+      <requiredServices>
+        <service>OOZIE</service>
+      </requiredServices>
 
       <configuration-dependencies>
         <config-type>falcon-env</config-type>

http://git-wip-us.apache.org/repos/asf/ambari/blob/84c4b434/ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/metainfo.xml
index 3f13983..1f15f8f 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/metainfo.xml
@@ -106,6 +106,10 @@
         <scriptType>PYTHON</scriptType>
         <timeout>300</timeout>
       </commandScript>
+      
+      <requiredServices>
+        <service>ZOOKEEPER</service>
+      </requiredServices>
 
       <configuration-dependencies>
         <config-type>storm-site</config-type>

http://git-wip-us.apache.org/repos/asf/ambari/blob/84c4b434/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/metainfo.xml
index e6ffd18..177d538 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/metainfo.xml
@@ -56,6 +56,10 @@
           </packages>
         </osSpecific>
       </osSpecifics>
+      
+      <requiredServices>
+        <service>YARN</service>
+      </requiredServices>
 
       <configuration-dependencies>
         <config-type>tez-site</config-type>

http://git-wip-us.apache.org/repos/asf/ambari/blob/84c4b434/ambari-server/src/test/java/org/apache/ambari/server/api/util/StackExtensionHelperTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/util/StackExtensionHelperTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/api/util/StackExtensionHelperTest.java
index 517f3b7..548ab88 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/util/StackExtensionHelperTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/util/StackExtensionHelperTest.java
@@ -280,6 +280,31 @@ public class StackExtensionHelperTest {
       }
     }
   }
+  
+  @Test
+  public void testrequiredServicesPropertyInheritance() throws Exception{
+    File stackRoot = new File(stackRootStr);
+    StackInfo stackInfo = new StackInfo();
+    stackInfo.setName("HDP");
+    stackInfo.setVersion("2.0.7");
+    StackExtensionHelper helper = new StackExtensionHelper(injector, stackRoot);
+    helper.populateServicesForStack(stackInfo);
+    helper.fillInfo();
+    List<ServiceInfo> allServices = helper.getAllApplicableServices(stackInfo);
+    assertEquals(13, allServices.size());
+    
+    List<String> expectedRequiredServices = new ArrayList<String>();
+    expectedRequiredServices.add("HDFS");
+    expectedRequiredServices.add("TEZ");
+    
+    for (ServiceInfo serviceInfo : allServices) {
+      if (serviceInfo.getName().equals("HBASE")) {
+        assertTrue(serviceInfo.getRequiredServices().equals(expectedRequiredServices));
+      } else {
+        assertTrue((serviceInfo.getRequiredServices() == null || serviceInfo.getRequiredServices().isEmpty()));
+      }
+    }
+  }
 
   @Test
   public void getSchemaVersion() throws Exception {

http://git-wip-us.apache.org/repos/asf/ambari/blob/84c4b434/ambari-server/src/test/resources/stacks/HDP/2.0.7/services/HBASE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/stacks/HDP/2.0.7/services/HBASE/metainfo.xml
b/ambari-server/src/test/resources/stacks/HDP/2.0.7/services/HBASE/metainfo.xml
index c114c83..e4a76c5 100644
--- a/ambari-server/src/test/resources/stacks/HDP/2.0.7/services/HBASE/metainfo.xml
+++ b/ambari-server/src/test/resources/stacks/HDP/2.0.7/services/HBASE/metainfo.xml
@@ -112,6 +112,10 @@
         <scriptType>PYTHON</scriptType>
         <timeout>50</timeout>
       </commandScript>
+      <requiredServices>
+        <service>HDFS</service>
+        <service>TEZ</service>
+      </requiredServices>
       <configuration-dependencies>
         <config-type>global</config-type>
         <config-type>hbase-policy</config-type>


Mime
View raw message