----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/63513/ -----------------------------------------------------------
(Updated Nov. 2, 2017, 7:30 p.m.) Review request for Ambari, Jonathan Hurley and Tim Thorpe. Bugs: AMBARI-22337 https://issues.apache.org/jira/browse/AMBARI-22337 Repository: ambari Description ------- xsi:type="server_action" tasks defined in EU/RU upgrade pack xml files currently can only classes from Ambari source code. This limites the server action that custom services / services from mpacks can perform. This JIRA proposes a way to allow each service to implement server action classes, package them in a jar to be loaded during EU 1. Each service can have a server_actions (support stack inheritance) such as /var/lib/ambari-server/resources/stacks/HDP/2.5/services/ZOOKEEPER/server_actions. a) The dir contains jar for the server action classes. /var/lib/ambari-server/resources/stacks/HDP/2.5/services/ZOOKEEPER/server_actions [root@~ server_actions]# ll total 8 rw-rr- 1 root root 7510 Oct 30 10:49 test_full.jar 2. upgrade pack can then invoke the server action as shown below <!-- server action test without specifying a service in the execution stage--> <group xsi:type="cluster" name="TEST_A" title="Test abc"> <execute-stage title="aaaa"> <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.SATestWithoutService"/> </execute-stage> </group> <!-- server action test with a service specified in the execution stage--> <execute-stage service="ZOOKEEPER" component="ZOOKEEPER_SERVER" title="Parame terizing Zookeeper Log4J Properties"> <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.SATestWithService"> <summary>zkpr test</summary> </task> </execute-stage> Diffs (updated) ----- ambari-server/pom.xml a86acf5 ambari-server/src/main/java/org/apache/ambari/server/serveraction/ServerActionExecutor.java 50e3cfe ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceDirectory.java 119163e ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceModule.java 3b3d52c ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java 8fe6583 ambari-server/src/test/java/org/apache/ambari/server/stack/ServiceModuleTest.java dbdd043 ambari-server/src/test/java/org/apache/ambari/server/stack/StackManagerExtensionTest.java 6617b33 Diff: https://reviews.apache.org/r/63513/diff/2/ Changes: https://reviews.apache.org/r/63513/diff/1-2/ Testing ------- unit tests, patch a trunk cluster with upgrade.xml changes and java changes, run EU, verify the external server action classes ran and were able to provide response back to EU. Thanks, Di Li