You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by nc...@apache.org on 2013/03/12 20:37:51 UTC
svn commit: r1455677 - in /incubator/ambari/trunk: ./
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/
Author: ncole
Date: Tue Mar 12 19:37:51 2013
New Revision: 1455677
URL: http://svn.apache.org/r1455677
Log:
AMBARI-1619. Fix for category path separators
Modified:
incubator/ambari/trunk/CHANGES.txt
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractResourceProvider.java
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BaseProvider.java
Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1455677&r1=1455676&r2=1455677&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Tue Mar 12 19:37:51 2013
@@ -458,6 +458,8 @@ Trunk (unreleased changes):
BUG FIXES
+ AMBARI-1619. Fix for category path separators.
+
AMBARI-1616. Error during upgrading Ambari Server from 1.2.0/1.2.1 to
1.2.2. (Sumit Mohanty via swagle)
Modified: incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractResourceProvider.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractResourceProvider.java?rev=1455677&r1=1455676&r2=1455677&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractResourceProvider.java (original)
+++ incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractResourceProvider.java Tue Mar 12 19:37:51 2013
@@ -371,7 +371,7 @@ public abstract class AbstractResourcePr
throw new IllegalArgumentException("Unknown type " + type);
}
}
-
+
/**
* Helper method to get a configuration request, if one exists.
* @param parentCategory the parent category name. Checks for a property
@@ -379,25 +379,25 @@ public abstract class AbstractResourcePr
* @param properties the properties on the request.
*/
protected ConfigurationRequest getConfigurationRequest(String parentCategory, Map<String, Object> properties) {
-
+
ConfigurationRequest config = null;
-
+
// as a convenience, allow consumers to specify name/value overrides in this
// call instead of forcing a cluster call to do that work
for (Entry<String, Object> entry : properties.entrySet()) {
String absCategory = PropertyHelper.getPropertyCategory(entry.getKey());
String propName = PropertyHelper.getPropertyName(entry.getKey());
-
- if (absCategory.startsWith(parentCategory + ".desired_config")) {
+
+ if (absCategory.startsWith(parentCategory + "/desired_config")) {
config = (null == config) ? new ConfigurationRequest() : config;
-
+
if (propName.equals("type"))
config.setType(entry.getValue().toString());
else if (propName.equals("tag"))
config.setVersionTag(entry.getValue().toString());
else if (propName.equals("service_name"))
config.setServiceName(entry.getValue().toString());
- else if (absCategory.endsWith(".properties")) {
+ else if (absCategory.endsWith("/properties")) {
config.getProperties().put(propName, entry.getValue().toString());
}
}
Modified: incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BaseProvider.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BaseProvider.java?rev=1455677&r1=1455676&r2=1455677&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BaseProvider.java (original)
+++ incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BaseProvider.java Tue Mar 12 19:37:51 2013
@@ -75,25 +75,25 @@ public abstract class BaseProvider {
// ----- BaseProvider --------------------------------------------------
/**
- * Checks for properties ids that are not recognized to the provider.
+ * Checks for property ids that are not recognized by the provider.
* @param base the base set of properties
* @param configCategory the config category that would have a <code>desired_config</code> element.
* @return the set of properties that are NOT known to the provider
*/
protected Set<String> checkConfigPropertyIds(Set<String> base, String configCategory) {
-
+
if (0 == base.size())
return base;
-
+
Set<String> unsupported = new HashSet<String>();
-
+
for (String propertyId : base)
{
- if (!propertyId.startsWith (configCategory + ".desired_config"))
+ if (!propertyId.startsWith(configCategory + "/desired_config"))
unsupported.add(propertyId);
}
-
- return unsupported;
+
+ return unsupported;
}
public Set<String> checkPropertyIds(Set<String> propertyIds) {