Alexey Serbin has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/14177 )

Change subject: KUDU-2780: create thread for auto-rebalancing
......................................................................


Patch Set 14:

(5 comments)

some more comments

http://gerrit.cloudera.org:8080/#/c/14177/14/src/kudu/master/auto_rebalancer-test.cc
File src/kudu/master/auto_rebalancer-test.cc:

http://gerrit.cloudera.org:8080/#/c/14177/14/src/kudu/master/auto_rebalancer-test.cc@159
PS14, Line 159: shared_ptr
nit: any special requirements to necessitate usage of std::shared_ptr?  If so, 
please add a comment describing why.  Otherwise, maybe std::unique_ptr is good 
enough here?


http://gerrit.cloudera.org:8080/#/c/14177/14/src/kudu/master/auto_rebalancer-test.cc@161
PS14, Line 161: shared_ptr
ditto


http://gerrit.cloudera.org:8080/#/c/14177/14/src/kudu/master/auto_rebalancer.cc
File src/kudu/master/auto_rebalancer.cc:

http://gerrit.cloudera.org:8080/#/c/14177/14/src/kudu/master/auto_rebalancer.cc@207
PS14, Line 207:     
SleepFor(MonoDelta::FromSeconds(FLAGS_auto_rebalancing_interval_seconds));
I think it's better to use 
ConditionVariable::WaitFor(FLAGS_auto_rebalancing_interval_seconds) approach 
here to be able to wake up and exit from the loop once 
AutoRebalancerTask::Shutdown() is called.  Then you can combine that 'if 
(closing_)' condition above with the wait.

For a reference implementation you could take a look at  'wake_up_cv_' in 
hms_notification_log_listener.{h,cc}.


http://gerrit.cloudera.org:8080/#/c/14177/14/src/kudu/master/auto_rebalancer.cc@271
PS14, Line 271:     do {
I think it make sense to check for 'closing_' while waiting for the replica 
movement.  You could employ the same approach with WaitFor() on the same 
condition variable as I mentioned in my comment above.


http://gerrit.cloudera.org:8080/#/c/14177/14/src/kudu/tools/rebalancer_tool.cc
File src/kudu/tools/rebalancer_tool.cc:

http://gerrit.cloudera.org:8080/#/c/14177/14/src/kudu/tools/rebalancer_tool.cc@981
PS14, Line 981:
nit: extra spaces



--
To view, visit http://gerrit.cloudera.org:8080/14177
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ifca25d1063c07047cf2123e6792b3c7395be20e4
Gerrit-Change-Number: 14177
Gerrit-PatchSet: 14
Gerrit-Owner: Hannah Nguyen <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Andrew Wong <[email protected]>
Gerrit-Reviewer: Hannah Nguyen <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Comment-Date: Tue, 11 Feb 2020 05:23:27 +0000
Gerrit-HasComments: Yes

Reply via email to