aweisberg commented on code in PR #3777:
URL: https://github.com/apache/cassandra/pull/3777#discussion_r1917070812
##########
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:
Those usages are picking timeouts that aren't based on a deadline that is
taken from somewhere else they come straight from configuration where yeah it
makes sense to use them directly since it and they end up being converted to a
`long` and a `TimeUnit` because that is what all the concurrency primitives use.
In this instance what mixing and matching are you referring to? This is
literally the only instance of `DurationSpec` (also why conflate `Duration` and
`DurationSpec`) in all of TCM and it's just using the configuration directly
because `DurationSpec` is what we use in `Config`.
I don't really care enough to fuss over this, but it's bizarre that this
became important and you are citing code style when there is no such code style
being used everywhere. If you look at the call hierarchy for `DurationSpec` it
is exclusively used for static configuration not deadline calculation. What you
are requesting is the opposite of being consistent with the code style.
It's doesn't really matter, it's a minor deviation, happy to do it to keep
everything unblocked, but I am surprised that you think it's the way to go.
--
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]