Adar Dembo has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/8130 )

Change subject: periodic: add one-shot timers
......................................................................

periodic: add one-shot timers

One-shot timers will Stop() themselves after running a user task once.

Note: it's worth pointing out that if Callback() races with Snooze(), the
outcome is somewhat undefined. That is, there's no telling whether the
currently running callback will run the task or snooze it. The same holds
for one-shot timers, albeit more profoundly, as Callback() can also race
with Start(). To avoid this, Start() the one-shot timer from within the
task, or right after the task.

I also refactored one-shot and jitter percentage into a new options struct.

Change-Id: Ia4d9376172d66c92958071d5abbac63d751e41f3
Reviewed-on: http://gerrit.cloudera.org:8080/8130
Tested-by: Adar Dembo <a...@cloudera.com>
Reviewed-by: Alexey Serbin <aser...@cloudera.com>
---
M src/kudu/rpc/periodic-test.cc
M src/kudu/rpc/periodic.cc
M src/kudu/rpc/periodic.h
3 files changed, 138 insertions(+), 18 deletions(-)

Approvals:
  Adar Dembo: Verified
  Alexey Serbin: Looks good to me, approved

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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia4d9376172d66c92958071d5abbac63d751e41f3
Gerrit-Change-Number: 8130
Gerrit-PatchSet: 4
Gerrit-Owner: Adar Dembo <a...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <a...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <aser...@cloudera.com>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <t...@apache.org>

Reply via email to