cshannon commented on PR #4494: URL: https://github.com/apache/accumulo/pull/4494#issuecomment-2081167758
@keith-turner and @DomGarguilo - I spent quite a bit of time looking at this today to make sure the existing SteadyTime behavior was correct before making more changes and this seems like it will generally work ok. It works by just keeping track of the difference in elapsed time and tracks it across restarts and I verified that it works even with negative nano time (Which is allowed). As long as all the places that use `SteadyTime` just use it as a diff between the current nano time it should be ok. For my latest updates, I looked at the `NanoTime` class as @DomGarguilo mentioned but did not use it and instead updated my PR to use `Duration` for both the `skewAmount` and `SteadyTime` as `NanoTime` didn't make sense in this case. NanoTime represents a wrapper around the current NanoTime of the system, but both of those other values represent something different. 1. The `skewAmount` is the difference in time from previous manager runs to the current system time and can be negative or positive so it is really just a Duration and no relation to the current time. 2. `SteadyTime` represents the elapsed time since the system started running (across managers) and is always a positive elapsed duration so I also used a Duration and added a precondition check check to verify it's never negative when created as a negative value would break everything. Anyways, I think this is looking a lot better now. The SteadyTime object that is returned will always be guaranteed to be the positive estimated elasped time in nanos across managers. It also now supports getting the nanos and not just millis if places in the code that current use miillis prefer to use that. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
