keith-turner commented on code in PR #4785:
URL: https://github.com/apache/accumulo/pull/4785#discussion_r1711828188


##########
core/src/main/java/org/apache/accumulo/core/fate/ZooStore.java:
##########
@@ -164,8 +164,10 @@ public long reserve() {
             }
 
             if (deferred.containsKey(tid)) {
-              if (deferred.get(tid).elapsed().compareTo(Duration.ZERO) > 0) {
-                deferred.remove(tid);
+              long deferredTime = deferred.get(tid);
+              long currentTime = System.nanoTime();
+              if (currentTime >= deferredTime) {

Review Comment:
   >  If we want a Countdown timer instead of an Elapsed timer, then we should 
just create a separate timer that counts down, with explicit semantics in its 
its API
   
   That would be nice to have.  Using nanotime directly is a maintenance burden 
because any change can easily introduce comparison or unit conversion bugs.  It 
would be a nice goal if nanotime were only used used via unit tested classes 
that do not allow those two problems to occur.  The addition of the offset to 
Timer achieves this goal but a new class would be a nicer way to achieve the 
same goal.



-- 
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]

Reply via email to