NealSun96 commented on a change in pull request #973:
URL: https://github.com/apache/helix/pull/973#discussion_r420337963
##########
File path:
helix-core/src/main/java/org/apache/helix/task/TaskStateModelFactory.java
##########
@@ -81,6 +79,12 @@ public Thread newThread(Runnable r) {
@Override
public TaskStateModel createNewStateModel(String resourceName, String
partitionKey) {
+ if (_taskExecutor == null) {
Review comment:
By separating the code into multiple functions based on its purpose, I
made it easier to understand. If I combine them, I either name the function
`initializeTaskExecutorAndTaskMonitorAndUpdateLiveInstance()` or I force
developers to read the code with no clue from the function titles. I'm sure it
was clear for you to take a glance and understand what this block is doing
because the function names explain them.
This is a nit, so I don't have that strong of an opinion, but I believe it
is correct to break down code into logical groups. To answer your question, "do
you have a scenario that you need to call these methods separately?", the
answer is yes. I could be utilizing `initializeTaskMonitor()` separately in the
other constructor; I'm not doing it because I think that constructor should be
gone (see conversation above).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]