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

Vlad Rozov commented on APEXCORE-771:
-------------------------------------

++1. The monolithic implementation of StreamingAppMasterService.execute() is 
hard to test and is hard to maintain. It also leads to spaghetti code. There 
were few bugs reported in that area, 
https://github.com/apache/apex-core/pull/535 is not the only one. 
https://github.com/apache/apex-core/pull/565 is another example.

> Refactor the function StreamingAppMasterService.execute() for maintainability
> -----------------------------------------------------------------------------
>
>                 Key: APEXCORE-771
>                 URL: https://issues.apache.org/jira/browse/APEXCORE-771
>             Project: Apache Apex Core
>          Issue Type: Improvement
>            Reporter: Sanjay M Pujare
>
> PR #535 discussion is the reason for this PR.
> Refactoring StreamingAppMasterService.execute() would consist of splitting 
> this code into multiple smaller functions (or even classes) and using mocks 
> to unit test these smaller chunks. For example we can create a class and move 
> all the requested/released container list and count management in this class. 
> This way the code in StreamingAppMasterService.execute() will be manageably 
> small.
> Benefits from this refactoring effort are:
> - code will be easy to understand and maintain for new members because of 
> multiple small functions or classes
> - it will be easy to simulate various corner or error cases related to Yarn 
> behavior using mocks that currently are impossible to simulate
> - for every new bug reported we will be able to add unit tests to create a 
> regression test suite.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to