Hello Mike Percy, Adar Dembo,

I'd like you to do a code review.  Please visit

    http://gerrit.cloudera.org:8080/3963

to review the following change.

Change subject: monotime: use a signed integer for the value
......................................................................

monotime: use a signed integer for the value

MonoTime previously used a uint64_t to store its value. This caused
problems in code patterns like:

  MonoTime gc_point = now;
  now.AddDelta(MonoTime::FromSeconds(-3600));
  if (gc_point.ComesBefore(some_other_time)) {
     ...
  }

In particular, the subtraction from 'gc_point' caused the unsigned
integer to wrap around such that _no_ time came before it.

One solution would have been to avoid the above pattern and only allow
adding positive deltas to a MonoTime. But, an easier one is to just use
a signed integer for the internal representation.

Change-Id: I68ce7b73a9a67becf91863161f0ae769153fe438
---
M src/kudu/util/monotime.h
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/63/3963/1
-- 
To view, visit http://gerrit.cloudera.org:8080/3963
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I68ce7b73a9a67becf91863161f0ae769153fe438
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <t...@apache.org>
Gerrit-Reviewer: Adar Dembo <a...@cloudera.com>
Gerrit-Reviewer: Mike Percy <mpe...@apache.org>

Reply via email to