Alexey Serbin has posted comments on this change.

Change subject: Allow to build a MonoTime from a MonoDelta
......................................................................


Patch Set 2:

> the point is to be able to get a monotime from the hybrid clock
 > like in here: 
 > https://gerrit.cloudera.org/#/c/5305/3/src/kudu/consensus/time_manager.cc
 > 
 > I like the idea of having an enum for the domain. will do


Thank you for the reference to the sample code.  After looking into that code, 
I added a comment on the in-line, but just in case I'll re-iterate it right 
here:


Instead of the line of conversions like

(Timestamp, Timestamp) --> (MonoTime, MonoTime) --> MonoDelta

and creating MonoTime objects in different domains, why not to implement 
operator-(const Timestamp&, const Timestamp&) for getting difference of 
timestamps and then just do

MonoDelta diff(MonoDelta::FromMicroseconds(clock.GetPhysicalValueMicros(t1 - 
t0)))

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I100e72cf4ac5cf23570e69e32a998253a63c6505
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: David Ribeiro Alves <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: David Ribeiro Alves <[email protected]>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <[email protected]>
Gerrit-Reviewer: Todd Lipcon <[email protected]>
Gerrit-HasComments: No

Reply via email to