[
https://issues.apache.org/jira/browse/PHOENIX-5204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16797620#comment-16797620
]
Geoffrey Jacoby commented on PHOENIX-5204:
------------------------------------------
[~swaroopa] - Improving the code quality of UpsertCompiler.compile (or any of
our overly-long classes or methods) by breaking it into more manageable pieces
is a wonderful idea.
Some general advice:
1. Be careful to make sure there's adequate test coverage before you start, so
you can make sure all your refactoring operations don't have side effects. If
there aren't good unit tests that can be run quickly, consider writing some.
2. Go step-by-step -- rather than doing a bunch of refactoring in one go and
then testing, test frequently. Inevitably, you're going to break something, and
this way you'll know quickly what step went wrong.
3. Consider creating multiple JIRAs as subtasks of this one, so they can be
reviewed / committed separately. This makes it easier for the committers doing
the reviews, easier for you to verify each one, and makes it easier for you to
stop and pick back up the process (or have others help) without having to
wrestle with a single monster patch.
> Breaking UpsertCompiler#compile function into small readable functions
> ----------------------------------------------------------------------
>
> Key: PHOENIX-5204
> URL: https://issues.apache.org/jira/browse/PHOENIX-5204
> Project: Phoenix
> Issue Type: Improvement
> Affects Versions: 4.14.1
> Reporter: Swaroopa Kadam
> Assignee: Swaroopa Kadam
> Priority: Minor
>
> Currently, UpsertCompile#compile method is ~500 lines and does multiple
> things listed below:
> # Upsert Select
> # Upsert Select (Client/Server side)
> # Upsert Values
> It would be better and cleaner to break the method into logically smaller and
> more readable methods.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)