[ 
https://issues.apache.org/jira/browse/YARN-2338?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14072638#comment-14072638
 ] 

tangjunjie commented on YARN-2338:
----------------------------------

Hello, Tsuyoshi OZAWA 
         I think service assembly should remove from resourcemanager because 
the main task for resourcemanager is alloct resource and so on.Consider use 
lightweight DI framwork like guice to refactor .Then, resourcemanager code will 
get rid of bad code smell. Use xml or annotation to display service assembley. 
For example,

<bean="org.apache.hadoop.yarn.server.resourcemanager.ResourceManager" scope 
="singleton">
     <bean 
="org.apache.hadoop.yarn.server.resourcemanager.ApplicationMasterService"/>
..............

</bean>

I think test code will also benifit from this refactor. Because we can easily 
mock a service then inject for test.



> service assemble so complex
> ---------------------------
>
>                 Key: YARN-2338
>                 URL: https://issues.apache.org/jira/browse/YARN-2338
>             Project: Hadoop YARN
>          Issue Type: Wish
>            Reporter: tangjunjie
>
>   See ResourceManager
> protected void serviceInit(Configuration configuration) throws Exception 
> So many service will assembe into resourcemanager.
> Use guice or other service assemble framework to refactor this complex code.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to