-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/27783/
-----------------------------------------------------------

(Updated Nov. 9, 2014, 7:11 p.m.)


Review request for Ambari, John Speidel, Mahadev Konar, Sumit Mohanty, Srimanth 
Gunturi, and Sid Wagle.


Bugs: AMBARI-8233
    https://issues.apache.org/jira/browse/AMBARI-8233


Repository: ambari


Description
-------

I created an HDP 2.2 cluster with all of the services except Knox, Kafka, and 
Slider, then exported the blueprint, and removed Ganglia from it.

Then, I attempted to create a single node cluster using the blueprints and ran 
into a regex error.

The problem is that one of the properties contains %HOSTGROUP::name% followed 
by another % and the regex match tries to do greedy matching instead of minimal.
For example, storm-site.xml had worker.childopts with
```
-Xmx768m _JAAS_PLACEHOLDER 
-javaagent:/usr/hdp/current/storm-client/contrib/storm-jmxetric/lib/jmxetric-1.0.4.jar=host=%HOSTGROUP::host_group_1%,port=8650,wireformat31x=true,mode=multicast,config=/usr/hdp/current/storm-client/contrib/storm-jmxetric/conf/jmxetric-conf.xml,process=Worker_%ID%_JVM
```

While the regex expression in BlueprintConfigurationProcessor.java is,
```
private static Pattern HOSTGROUP_REGEX = Pattern.compile("%HOSTGROUP::(\S+)%");
```

Instead, it should be,
```
private static Pattern HOSTGROUP_REGEX = Pattern.compile("%HOSTGROUP::(\S+?)%");
```

Steps to repro,
```
curl -H "X-Requested-By:ambari" -X POST -u admin:admin 
http://c6410.ambari.apache.org:8080/api/v1/blueprints/hdp22 -d 
@hdp_22_blueprint.json
curl -H "X-Requested-By:ambari" -X POST -u admin:admin 
http://c6410.ambari.apache.org:8080/api/v1/clusters/dev -d 
@single_node_cluster.json
```


Diffs
-----

  
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
 f1a6110 

Diff: https://reviews.apache.org/r/27783/diff/


Testing
-------

mvn clean test

[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 27:50.444s
[INFO] Finished at: Sat Nov 08 18:08:04 PST 2014
[INFO] Final Memory: 56M/486M
[INFO] ------------------------------------------------------------------------


Thanks,

Alejandro Fernandez

Reply via email to