ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject git commit: AMBARI-7404. configTypes field for stack service API should provide supports addProperty field. (aonishuk)
Date Fri, 19 Sep 2014 12:10:38 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 201bcb3e8 -> 05f0b402f


AMBARI-7404. configTypes field for stack service API should provide supports addProperty field.
(aonishuk)


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

Branch: refs/heads/trunk
Commit: 05f0b402fc8ee7d79325985ed4468809455e13ef
Parents: 201bcb3
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Fri Sep 19 15:10:30 2014 +0300
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Fri Sep 19 15:10:30 2014 +0300

----------------------------------------------------------------------
 .../server/api/util/StackExtensionHelper.java   |  3 +-
 .../src/main/resources/properties.json          |  1 +
 .../configuration/capacity-scheduler.xml        |  2 +-
 .../YARN/configuration/capacity-scheduler.xml   |  2 +-
 .../api/util/StackExtensionHelperTest.java      | 40 ++++++++++++++++++--
 .../services/YARN/configuration/yarn-site.xml   |  2 +-
 6 files changed, 42 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/05f0b402/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 2c5396b..fe6c6bc 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
@@ -916,7 +916,8 @@ public class StackExtensionHelper {
    */
   protected enum Supports {
 
-    FINAL("supports_final");
+    FINAL("supports_final"),
+    ADDING_FORBIDDEN("supports_adding_forbidden");
 
     public static final String KEYWORD = "supports";
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/05f0b402/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 76797d3..b99ede5 100644
--- a/ambari-server/src/main/resources/properties.json
+++ b/ambari-server/src/main/resources/properties.json
@@ -248,6 +248,7 @@
         "StackConfigurations/property_description",
         "StackConfigurations/type",
         "StackConfigurations/final",
+        "StackConfigurations/adding_forbidden",
         "StackConfigurations/property_type",
         "_"
     ],

http://git-wip-us.apache.org/repos/asf/ambari/blob/05f0b402/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/MAPREDUCE/configuration/capacity-scheduler.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/MAPREDUCE/configuration/capacity-scheduler.xml
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/MAPREDUCE/configuration/capacity-scheduler.xml
index 010a313..574d508 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/MAPREDUCE/configuration/capacity-scheduler.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/MAPREDUCE/configuration/capacity-scheduler.xml
@@ -22,7 +22,7 @@
 <!-- The properties for a queue follow a naming convention,such as, -->
 <!-- mapred.capacity-scheduler.queue.<queue-name>.property-name. -->
 
-<configuration supports_final="true">
+<configuration supports_final="true" supports_adding_forbidden="true">
 
   <property>
     <name>mapred.capacity-scheduler.maximum-system-jobs</name>

http://git-wip-us.apache.org/repos/asf/ambari/blob/05f0b402/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/configuration/capacity-scheduler.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/configuration/capacity-scheduler.xml
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/configuration/capacity-scheduler.xml
index 261d872..a8dc5c2 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/configuration/capacity-scheduler.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/configuration/capacity-scheduler.xml
@@ -15,7 +15,7 @@
    limitations under the License.
 -->
 
-<configuration supports_final="true">
+<configuration supports_final="true" supports_adding_forbidden="true">
 
   <property>
     <name>yarn.scheduler.capacity.maximum-applications</name>

http://git-wip-us.apache.org/repos/asf/ambari/blob/05f0b402/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 2219b6f..74761dd 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
@@ -343,9 +343,13 @@ public class StackExtensionHelperTest {
 
   private void addToPropertyMap(Map<String, Map<String, Map<String, String>>>
configTypes,String configType,
       String keyword, String attributeName, String value) {
-    configTypes.put(configType, new HashMap<String, Map<String, String>>());

-    Map<String, Map<String, String>> config = configTypes.get(configType); 
-    config.put(keyword, new HashMap<String, String>());
+    if(!configTypes.containsKey(configType)) {
+      configTypes.put(configType, new HashMap<String, Map<String, String>>());

+    }
+    Map<String, Map<String, String>> config = configTypes.get(configType);
+    if(!config.containsKey(keyword)) {
+      config.put(keyword, new HashMap<String, String>());
+    }
     Map<String, String> supports = config.get(keyword);
     supports.put(attributeName, value);    
   }
@@ -358,12 +362,20 @@ public class StackExtensionHelperTest {
     Map<String, Map<String, Map<String, String>>> expectedConfigTypes =
new HashMap<String, Map<String, Map<String, String>>>();
     addToPropertyMap(expectedConfigTypes, "global", StackExtensionHelper.Supports.KEYWORD,

         StackExtensionHelper.Supports.FINAL.getPropertyName(), "true");
+    addToPropertyMap(expectedConfigTypes, "global", StackExtensionHelper.Supports.KEYWORD,

+        StackExtensionHelper.Supports.ADDING_FORBIDDEN.getPropertyName(), "false");
     addToPropertyMap(expectedConfigTypes, "hdfs-site", StackExtensionHelper.Supports.KEYWORD,

         StackExtensionHelper.Supports.FINAL.getPropertyName(), "false");
+    addToPropertyMap(expectedConfigTypes, "hdfs-site", StackExtensionHelper.Supports.KEYWORD,

+        StackExtensionHelper.Supports.ADDING_FORBIDDEN.getPropertyName(), "false");
     addToPropertyMap(expectedConfigTypes, "hadoop-policy", StackExtensionHelper.Supports.KEYWORD,

         StackExtensionHelper.Supports.FINAL.getPropertyName(), "false");
+    addToPropertyMap(expectedConfigTypes, "hadoop-policy", StackExtensionHelper.Supports.KEYWORD,

+        StackExtensionHelper.Supports.ADDING_FORBIDDEN.getPropertyName(), "false");
     addToPropertyMap(expectedConfigTypes, "core-site", StackExtensionHelper.Supports.KEYWORD,

         StackExtensionHelper.Supports.FINAL.getPropertyName(), "false");
+    addToPropertyMap(expectedConfigTypes, "core-site", StackExtensionHelper.Supports.KEYWORD,

+        StackExtensionHelper.Supports.ADDING_FORBIDDEN.getPropertyName(), "false");
     
     Map<String, Map<String, Map<String, String>>> configTypes = serviceInfo.getConfigTypes();
     assertEquals(4, configTypes.size());
@@ -477,6 +489,8 @@ public class StackExtensionHelperTest {
     Map<String, Map<String, Map<String, String>>> expectedConfigTypes =
new HashMap<String, Map<String, Map<String, String>>>();
     addToPropertyMap(expectedConfigTypes, "yarn-site", StackExtensionHelper.Supports.KEYWORD,

         StackExtensionHelper.Supports.FINAL.getPropertyName(), "false");
+    addToPropertyMap(expectedConfigTypes, "yarn-site", StackExtensionHelper.Supports.KEYWORD,

+        StackExtensionHelper.Supports.ADDING_FORBIDDEN.getPropertyName(), "true");
     
     assertEquals(expectedConfigTypes, serviceInfo.getConfigTypes());
   }
@@ -493,12 +507,20 @@ public class StackExtensionHelperTest {
     Map<String, Map<String, Map<String, String>>> expectedConfigTypes =
new HashMap<String, Map<String, Map<String, String>>>();
     addToPropertyMap(expectedConfigTypes, "global", StackExtensionHelper.Supports.KEYWORD,

         StackExtensionHelper.Supports.FINAL.getPropertyName(), "true");
+    addToPropertyMap(expectedConfigTypes, "global", StackExtensionHelper.Supports.KEYWORD,

+        StackExtensionHelper.Supports.ADDING_FORBIDDEN.getPropertyName(), "false");
     addToPropertyMap(expectedConfigTypes, "hdfs-site", StackExtensionHelper.Supports.KEYWORD,

         StackExtensionHelper.Supports.FINAL.getPropertyName(), "false");
+    addToPropertyMap(expectedConfigTypes, "hdfs-site", StackExtensionHelper.Supports.KEYWORD,

+        StackExtensionHelper.Supports.ADDING_FORBIDDEN.getPropertyName(), "false");
     addToPropertyMap(expectedConfigTypes, "hadoop-policy", StackExtensionHelper.Supports.KEYWORD,

         StackExtensionHelper.Supports.FINAL.getPropertyName(), "false");
+    addToPropertyMap(expectedConfigTypes, "hadoop-policy", StackExtensionHelper.Supports.KEYWORD,

+        StackExtensionHelper.Supports.ADDING_FORBIDDEN.getPropertyName(), "false");
     addToPropertyMap(expectedConfigTypes, "core-site", StackExtensionHelper.Supports.KEYWORD,

         StackExtensionHelper.Supports.FINAL.getPropertyName(), "false");
+    addToPropertyMap(expectedConfigTypes, "core-site", StackExtensionHelper.Supports.KEYWORD,

+        StackExtensionHelper.Supports.ADDING_FORBIDDEN.getPropertyName(), "false");
     
     assertEquals(expectedConfigTypes, serviceInfo.getConfigTypes());
   }
@@ -514,14 +536,24 @@ public class StackExtensionHelperTest {
     Map<String, Map<String, Map<String, String>>> expectedConfigTypes =
new HashMap<String, Map<String, Map<String, String>>>();
     addToPropertyMap(expectedConfigTypes, "global", StackExtensionHelper.Supports.KEYWORD,

         StackExtensionHelper.Supports.FINAL.getPropertyName(), "true");
+    addToPropertyMap(expectedConfigTypes, "global", StackExtensionHelper.Supports.KEYWORD,

+        StackExtensionHelper.Supports.ADDING_FORBIDDEN.getPropertyName(), "false");
     addToPropertyMap(expectedConfigTypes, "hdfs-site", StackExtensionHelper.Supports.KEYWORD,

         StackExtensionHelper.Supports.FINAL.getPropertyName(), "false");
-    addToPropertyMap(expectedConfigTypes, "yarn-site", StackExtensionHelper.Supports.KEYWORD,

+    addToPropertyMap(expectedConfigTypes, "hdfs-site", StackExtensionHelper.Supports.KEYWORD,

+        StackExtensionHelper.Supports.ADDING_FORBIDDEN.getPropertyName(), "false");
+    addToPropertyMap(expectedConfigTypes, "hadoop-policy", StackExtensionHelper.Supports.KEYWORD,

         StackExtensionHelper.Supports.FINAL.getPropertyName(), "false");
     addToPropertyMap(expectedConfigTypes, "hadoop-policy", StackExtensionHelper.Supports.KEYWORD,

+        StackExtensionHelper.Supports.ADDING_FORBIDDEN.getPropertyName(), "false");
+    addToPropertyMap(expectedConfigTypes, "core-site", StackExtensionHelper.Supports.KEYWORD,

         StackExtensionHelper.Supports.FINAL.getPropertyName(), "false");
     addToPropertyMap(expectedConfigTypes, "core-site", StackExtensionHelper.Supports.KEYWORD,

+        StackExtensionHelper.Supports.ADDING_FORBIDDEN.getPropertyName(), "false");
+    addToPropertyMap(expectedConfigTypes, "yarn-site", StackExtensionHelper.Supports.KEYWORD,

         StackExtensionHelper.Supports.FINAL.getPropertyName(), "false");
+    addToPropertyMap(expectedConfigTypes, "yarn-site", StackExtensionHelper.Supports.KEYWORD,

+        StackExtensionHelper.Supports.ADDING_FORBIDDEN.getPropertyName(), "true");
     
     assertEquals(expectedConfigTypes, serviceInfo.getConfigTypes());
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/05f0b402/ambari-server/src/test/resources/stacks/HDP/2.0.7/services/YARN/configuration/yarn-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/stacks/HDP/2.0.7/services/YARN/configuration/yarn-site.xml
b/ambari-server/src/test/resources/stacks/HDP/2.0.7/services/YARN/configuration/yarn-site.xml
index 59b5245..3abb60b 100644
--- a/ambari-server/src/test/resources/stacks/HDP/2.0.7/services/YARN/configuration/yarn-site.xml
+++ b/ambari-server/src/test/resources/stacks/HDP/2.0.7/services/YARN/configuration/yarn-site.xml
@@ -19,7 +19,7 @@
 
 <!-- Put site-specific property overrides in this file. -->
 
-<configuration xmlns:xi="http://www.w3.org/2001/XInclude">
+<configuration xmlns:xi="http://www.w3.org/2001/XInclude" supports_adding_forbidden="true">
 
 <!-- ResourceManager -->
 


Mime
View raw message