> On Nov. 24, 2015, 8:57 p.m., Alejandro Fernandez wrote: > > ambari-server/src/main/java/org/apache/ambari/server/state/stack/StackRoleCommandOrder.java, > > line 123 > > <https://reviews.apache.org/r/40082/diff/1/?file=1119938#file1119938line123> > > > > What happens if both the parent and child define the same value?
If a child service has a role_command_order.json file then it replaces the parent's. It is not merged. I have also changed the way the stack merges in the role command orders from its services. This happens during the module finalize. This avoids the following issue: 1) MYSERVICE defines a role_command_order.json at both the HDP-2.3 and HDP.2.4 level 2) HDP-2.3 merges the role command order from MYSERVICE (at the HDP-2.3 stack level) 3) HDP-2.4 stack inherits the role command order from HDP-2.3 (including the role command order for MYSERVICE) 4) HDP-2.4 merges the role command order from MYSERVICE (at the HDP-2.4 stack level) Instead the inheritance/merge happens as follows: 1) All the stack inheritance is done including HDP-2.4 stack inheriting the role command order from HDP-2.3 2) All the role command orders at the service level are merged into their stack. This merges MYSERVICE from 2.3 into HDP-2.3 and MYSERVICE from 2.4 into HDP-2.4. - Tim ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/40082/#review107839 ----------------------------------------------------------- On Nov. 9, 2015, 3:47 p.m., Tim Thorpe wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/40082/ > ----------------------------------------------------------- > > (Updated Nov. 9, 2015, 3:47 p.m.) > > > Review request for Ambari and Sumit Mohanty. > > > Bugs: AMBARI-9363 > https://issues.apache.org/jira/browse/AMBARI-9363 > > > Repository: ambari > > > Description > ------- > > In current stack definitions, role_command_order.json is at the stack level. > For example: HDP/2.2/role_command_order.json > > Service definitions are all nicely separated into different directories, like > HDP/2.2/services/ > {HDFS|YARN} > > , but not the role_command_order. It would be neater to separate > role_command_order per service and would be very useful while adding a new > service to Ambari. > > Looking for something as below, > > HDP/2.2/services/HDFS/role_command_order.json > HDP/2.2/services/YARN/role_command_order.json > Ambari server while starting should merge all role_command_order.json and > create dependencies accordingly. > > This is extremely useful for custom services which are potentially added > after the cluster install. > > > Diffs > ----- > > > ambari-server/src/main/java/org/apache/ambari/server/stack/StackDirectory.java > 89c10c6bf917aebf1f5018217166e08e1f773f76 > > ambari-server/src/main/java/org/apache/ambari/server/state/stack/StackRoleCommandOrder.java > e7918591423e0a2e26d439e72d1a4d078ae7f53d > > ambari-server/src/test/java/org/apache/ambari/server/stack/StackManagerTest.java > 1e76b6bcc5c5dc641fa74386a3f855695a9cb7e4 > > ambari-server/src/test/resources/stacks/HDP/2.1.1/services/PIG/role_command_order.json > PRE-CREATION > > Diff: https://reviews.apache.org/r/40082/diff/ > > > Testing > ------- > > Running org.apache.ambari.server.stack.StackManagerTest > Tests run: 18, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.027 sec > > > Thanks, > > Tim Thorpe > >