You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Todd Lipcon (Code Review)" <ge...@cloudera.org> on 2016/08/13 02:48:34 UTC
[kudu-CR] monotime: use a signed integer for the value
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 <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
[kudu-CR] monotime: use a signed integer for the value
Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Todd Lipcon has submitted this change and it was merged.
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
Reviewed-on: http://gerrit.cloudera.org:8080/3963
Tested-by: Kudu Jenkins
Reviewed-by: Mike Percy <mp...@apache.org>
---
M src/kudu/util/monotime.h
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Mike Percy: Looks good to me, approved
Kudu Jenkins: Verified
--
To view, visit http://gerrit.cloudera.org:8080/3963
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I68ce7b73a9a67becf91863161f0ae769153fe438
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
[kudu-CR] monotime: use a signed integer for the value
Posted by "Mike Percy (Code Review)" <ge...@cloudera.org>.
Mike Percy has posted comments on this change.
Change subject: monotime: use a signed integer for the value
......................................................................
Patch Set 1: Code-Review+2
lgtm, assuming you did the napkin math and we have plenty of bits to go around
--
To view, visit http://gerrit.cloudera.org:8080/3963
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I68ce7b73a9a67becf91863161f0ae769153fe438
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-HasComments: No
[kudu-CR] monotime: use a signed integer for the value
Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Todd Lipcon has posted comments on this change.
Change subject: monotime: use a signed integer for the value
......................................................................
Patch Set 1:
yea, 2^63 microseconds is 292,277.266 years, so I dont think we're in danger of a system's uptime crossing that.
--
To view, visit http://gerrit.cloudera.org:8080/3963
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I68ce7b73a9a67becf91863161f0ae769153fe438
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: No
[kudu-CR] monotime: use a signed integer for the value
Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change.
Change subject: monotime: use a signed integer for the value
......................................................................
Patch Set 1:
Build Started http://104.196.14.100/job/kudu-gerrit/2856/
--
To view, visit http://gerrit.cloudera.org:8080/3963
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I68ce7b73a9a67becf91863161f0ae769153fe438
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-HasComments: No