DomGarguilo commented on code in PR #4785:
URL: https://github.com/apache/accumulo/pull/4785#discussion_r1704348513


##########
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:
   I was hoping to use the new `Timer` class here but ZooStore was relying on 
the, now removed, `nanoTime.subtract()` and `NanoTime.nowPlus()` methods. I 
could not think of a clean way to perform this functionality with the Timer 
class so I just changed it to use long.
   
   ZooStore was the only place where these two methods of NanoTime were being 
used so I thought it would be okay to remove those. They could either be added 
back or if someone else can think of a good way to use `Timer` here that would 
be even better.



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