[ https://issues.apache.org/jira/browse/WHIRR-221?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13198535#comment-13198535 ]
David Alves edited comment on WHIRR-221 at 2/2/12 5:32 AM: ----------------------------------------------------------- Hi I'm working on this, I started from scratch a while ago and I just now got the time to start to put things together. Andrei: I would prefer not to use annotations since dependencies might depend on configuration. So the idea is: add a getDependedOnRole() method to ClusterActionController. This method returns the set of roles this role needs before it can start. This might be fixes (e.g. hard-coded into the ClusterActionController class) or it might be configurable through the properties file. In each phase (configure, bootstrap start etc) the a Action calls dependency analyzer that returns a set of stages. Each stage has a set of roles that can be started in parallel and must finish before the next stage. The dependency graph is build based on calls to getDependedOnRole(). The roots are services that depend on no one, the next stage is composed of the root's children, etc. Still too early for a patch as I'm still finishing things up, but if you guys could take a look at the dependency analyzer, your feedback would b much appreciated. here are the github links: https://github.com/dralves/whirr/blob/whirr-221/core/src/main/java/org/apache/whirr/service/DependencyAnalyzer.java https://github.com/dralves/whirr/blob/whirr-221/core/src/main/java/org/apache/whirr/service/ClusterActionHandlerSupport.java https://github.com/dralves/whirr/blob/whirr-221/core/src/test/java/org/apache/whirr/service/DependencyAnalyzerTest.java To come: the changes to ScriptBasedClusterAction (ongoing) and the dryrun test. was (Author: dr-alves): Hi I'm working on this, I started from scratch a while ago and I just now got the time to start to put things together. Andrei: I would prefer not to use annotations since dependencies might depend on configuration. So the idea is: add a getDependedOnRole() method to ClusterActionController. This method returns the set of roles this role needs before it can start. This might be fixes (e.g. hard-coded into the ClusterActionController class) or it might be configurable through the properties file. In each phase (configure, bootstrap start etc) the a Action calls dependency analyzer that returns a set of stages. Each stage has a set of roles that can be started in parallel and must finish before the next stage. The dependency graph is build based on calls to getDependedOnRole(). The roots are services that depend on no one, the next stage is composed of the root's children, etc. Still too early for a patch as I'm still finishing things up, but if you guys would wan't to take a look at the dependency analyzer and the new clusteractionhandler here are the github links: https://github.com/dralves/whirr/blob/whirr-221/core/src/main/java/org/apache/whirr/service/DependencyAnalyzer.java https://github.com/dralves/whirr/blob/whirr-221/core/src/main/java/org/apache/whirr/service/ClusterActionHandlerSupport.java https://github.com/dralves/whirr/blob/whirr-221/core/src/test/java/org/apache/whirr/service/DependencyAnalyzerTest.java > Optionally control the order of starting services > ------------------------------------------------- > > Key: WHIRR-221 > URL: https://issues.apache.org/jira/browse/WHIRR-221 > Project: Whirr > Issue Type: New Feature > Components: core, documentation > Reporter: Andrei Savu > Assignee: Andrei Savu > Priority: Critical > Fix For: 0.8.0 > > Attachments: WHIRR-221-v1.patch, WHIRR-221-v3.patch, WHIRR-221.patch > > > As Lars sugested in WHIRR-170: > The user should "be able to optionally control the order (services start). > This could be role based and specified like so > {code} > whirr.role-order=zk,nn+jt,dn+tt,hbase-master,hbase-regionserver > {code} > If not specified the system should make any effort to start the services as > quickly as possible, for example in multiple threads. In other words, when > the role-order is not given no guarantee about order can be given." -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira