mesos-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yan Xu <...@jxu.me>
Subject Duration-Time related refactoring chain
Date Tue, 14 May 2013 18:51:37 GMT
Some changes on the same class appears that they could be consolidated but
it wasn't easy to do so and I think there is merit in keeping the history.

## Bug Fix
1. Fixed Duration's stream insertion operator so that the output string
does not have trailing zeros after the decimal point. (libstout):
https://reviews.apache.org/r/11134

## Clock::now() returns "double -> Duration"

2. Added a default constructor for Seconds for Clock::now() to return
Seconds. (libstout): https://reviews.apache.org/r/11136
3. Updated Clock::now() and Clock::now(ProcessBase*) to return a "Seconds".
(libprocess): https://reviews.apache.org/r/11137
4. Updates due to Clock::now() and Clock::now(ProcessBase*) now returning a
"Seconds": https://reviews.apache.org/r/11138

## Storing integer in Duration
- Per our initial discussion we decided to keep the constructors using
doubles because some third-party APIs still use them.

5. Changed Duration to use int64_t to store the value in nanoseconds for
better precision. (libstout): https://reviews.apache.org/r/11139
6. Fix due to Seconds can no longer hold DBL_MAX correctly. (libprocess):
https://reviews.apache.org/r/11140

## Time
7. Added a Time class as a new abstraction that works with Duration for
various time related calculations. (libprocess):
https://reviews.apache.org/r/11142
8. Replaced usage of "Seconds" and "Duration" that represents time with the
new "Time". (libprocess): https://reviews.apache.org/r/11143

## Duration adopts integer constructors
- We now decided to get rid of "double" constructors. For cases where a
Duration needs to be constructed from a "double", a Try method is added.

9. Changed Duration to 1) use integers in constructors; 2) include
overloaded multiplication & division operators. (libstout):
https://reviews.apache.org/r/11145
10. Fixes in libprocess due to the new Duration API. (libprocess):
https://reviews.apache.org/r/11146
11. Fixes due to the new Duration API. (Mesos):
https://reviews.apache.org/r/11147

## More Refactoring on eliminating time in the "double" type.
12. Changed various *time* variables to use the "Time" type instead of
"double": https://reviews.apache.org/r/11148

Yan

--
Jiang Yan Xu <yan@jxu.me> @xujyan <http://twitter.com/xujyan>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message