[ https://issues.apache.org/jira/browse/APEXCORE-771?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sanjay M Pujare updated APEXCORE-771: ------------------------------------- Description: 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. was: 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. > 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)