Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 424164dca -> ccc56918b


AMBARI-12589. Blueprint config processor should retain property 
hbase.coprocessor.region.classes with default value (smohanty)


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

Branch: refs/heads/branch-2.1
Commit: ccc56918b0a69983468a7392c37c977d2f54659c
Parents: 424164d
Author: Sumit Mohanty <[email protected]>
Authored: Thu Jul 30 17:46:27 2015 -0700
Committer: Sumit Mohanty <[email protected]>
Committed: Thu Jul 30 18:03:15 2015 -0700

----------------------------------------------------------------------
 .../internal/BlueprintConfigurationProcessor.java      |  5 ++++-
 .../internal/BlueprintConfigurationProcessorTest.java  | 13 ++++++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ccc56918/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
index bf05326..892cf32 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
@@ -66,6 +66,7 @@ public class BlueprintConfigurationProcessor {
   private final static String CLUSTER_ENV_CONFIG_TYPE_NAME = "cluster-env";
 
   private final static String HBASE_SITE_HBASE_COPROCESSOR_MASTER_CLASSES = 
"hbase.coprocessor.master.classes";
+  private final static String HBASE_SITE_HBASE_COPROCESSOR_REGION_CLASSES = 
"hbase.coprocessor.region.classes";
 
   /**
    * Single host topology updaters
@@ -288,7 +289,9 @@ public class BlueprintConfigurationProcessor {
    * @return
    */
   private static boolean shouldPropertyBeStoredWithDefault(String 
propertyName) {
-    if (!StringUtils.isBlank(propertyName) && 
HBASE_SITE_HBASE_COPROCESSOR_MASTER_CLASSES.equals(propertyName)) {
+    if (!StringUtils.isBlank(propertyName) &&
+        (HBASE_SITE_HBASE_COPROCESSOR_MASTER_CLASSES.equals(propertyName) ||
+         HBASE_SITE_HBASE_COPROCESSOR_REGION_CLASSES.equals(propertyName))) {
       return true;
     }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ccc56918/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
index 5f5e317..a881472 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
@@ -4073,8 +4073,18 @@ public class BlueprintConfigurationProcessorTest {
           }
         };
 
+    Stack.ConfigProperty configProperty3 =
+        new Stack.ConfigProperty("hbase-site", 
"hbase.coprocessor.region.classes", "") {
+          @Override
+          Set<PropertyDependencyInfo> getDependsOnProperties() {
+            PropertyDependencyInfo dependencyInfo = new 
PropertyDependencyInfo("hbase-site", "hbase.security.authorization");
+            return Collections.singleton(dependencyInfo);
+          }
+        };
+
     mapOfMetadata.put("hbase.coprocessor.regionserver.classes", 
configProperty1);
     mapOfMetadata.put("hbase.coprocessor.master.classes", configProperty2);
+    mapOfMetadata.put("hbase.coprocessor.region.classes", configProperty3);
 
     // defaults from init() method that we need
     expect(stack.getName()).andReturn("testStack").anyTimes();
@@ -4107,7 +4117,8 @@ public class BlueprintConfigurationProcessorTest {
                 
hbaseSiteProperties.containsKey("hbase.coprocessor.regionserver.classes"));
     assertTrue("hbase.coprocessor.master.classes should not have been filtered 
out of configuration",
                
hbaseSiteProperties.containsKey("hbase.coprocessor.master.classes"));
-
+    assertTrue("hbase.coprocessor.region.classes should not have been filtered 
out of configuration",
+               
hbaseSiteProperties.containsKey("hbase.coprocessor.master.classes"));
   }
 
   @Test

Reply via email to