Alexey Serbin has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/15156 )

Change subject: [clock] simplify system time source
......................................................................

[clock] simplify system time source

This changelist updates the SystemNtp time provider to use ntp_gettime()
instead of ntp_adjtime() to retrieve current wall-clock time
(both functions are from the NTP kernel API, see [1] for details).

As it turned out, the 'tolerance' field from timex structure is
architecture-dependent constant and never changes: I verified that
for Linux and FreeBSD kernels. So, it's possible to call ntp_adjtime()
in Init() and then use the retrieved value to calculate the clock's
skew upper bound just once.

In addition, this patch enables the 'system' time source for macOS
HighSierra and newer, where the NTP kernel API is supported.

[1] http://man7.org/linux/man-pages/man3/ntp_gettime.3.html

Change-Id: Ib197effb63e8f5e37fd828c88e705112bb7047ce
Reviewed-on: http://gerrit.cloudera.org:8080/15156
Reviewed-by: Adar Dembo <[email protected]>
Tested-by: Kudu Jenkins
---
M src/kudu/clock/CMakeLists.txt
M src/kudu/clock/hybrid_clock.cc
M src/kudu/clock/system_ntp.cc
M src/kudu/clock/system_ntp.h
4 files changed, 62 insertions(+), 50 deletions(-)

Approvals:
  Adar Dembo: Looks good to me, approved
  Kudu Jenkins: Verified

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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib197effb63e8f5e37fd828c88e705112bb7047ce
Gerrit-Change-Number: 15156
Gerrit-PatchSet: 5
Gerrit-Owner: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Adar Dembo <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Volodymyr Verovkin <[email protected]>

Reply via email to