Repository: ambari
Updated Branches:
  refs/heads/trunk 3287763ca -> 327519cde


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/327519cd
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/327519cd
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/327519cd

Branch: refs/heads/trunk
Commit: 327519cde317ef97c8abe90b30b22e748219c773
Parents: 3287763
Author: Sumit Mohanty <[email protected]>
Authored: Thu Jul 30 17:46:27 2015 -0700
Committer: Sumit Mohanty <[email protected]>
Committed: Thu Jul 30 17:46:27 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/327519cd/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/327519cd/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