aweisberg commented on code in PR #3777:
URL: https://github.com/apache/cassandra/pull/3777#discussion_r1915420215


##########
src/java/org/apache/cassandra/tcm/log/LocalLog.java:
##########
@@ -707,15 +710,21 @@ private Async(LogSpec logSpec)
 
         @Override
         public ClusterMetadata awaitAtLeast(Epoch epoch) throws 
InterruptedException, TimeoutException
+        {
+            return awaitAtLeast(epoch, -1, null);
+        }
+
+        @Override
+        public ClusterMetadata awaitAtLeast(Epoch epoch, long timeout, 
TimeUnit unit) throws InterruptedException, TimeoutException
         {
             ClusterMetadata lastSeen = committed.get();
             return lastSeen.epoch.compareTo(epoch) >= 0
                    ? lastSeen
-                   : new AwaitCommit(epoch).get();
+                   : new AwaitCommit(epoch).get(timeout, unit);
         }
 
         @Override
-        public void runOnce(DurationSpec duration) throws TimeoutException
+        public void runOnce(long timeout, TimeUnit unit) throws 
TimeoutException

Review Comment:
   This is the normal idiom for communicating a timeout in Java? It really 
looks like the usage of `DurationSpec` here (the one and only usage) was not an 
intentional choice it was just forwarding the configuration from 
`DatabaseDescriptor`.
   
   There are more states, I do end up using them instead of have two separate 
implementations (wait forever, wait with timeout).



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to