belliottsmith commented on code in PR #113: URL: https://github.com/apache/cassandra-accord/pull/113#discussion_r1746014630
########## accord-core/src/main/java/accord/impl/DefaultRequestTimeouts.java: ########## @@ -0,0 +1,146 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package accord.impl; + +import java.util.concurrent.TimeUnit; +import java.util.concurrent.locks.ReentrantLock; +import java.util.function.Function; + +import accord.api.RequestTimeouts; +import accord.local.Node; +import accord.utils.LogGroupTimers; + +import static java.util.concurrent.TimeUnit.MILLISECONDS; +import static java.util.concurrent.TimeUnit.SECONDS; +import static org.agrona.BitUtil.findNextPositivePowerOfTwo; + +public class DefaultRequestTimeouts implements RequestTimeouts Review Comment: So, this particular class just wraps `LogGroupTimers` which stands in for the `DeadlineTimerWheel`. Both are thread-unsafe, and so this class' wrapping would be needed in both cases. `DeadlineTimerWheel` also only operates on integer ids, so you have to maintain a separate mapping, and also requires scheduling. The main difference is that this has dynamic granularity, does not need to right-size buckets or clock periods, and can schedule itself only when necessary. It also has better guarantees about its constant time operations when timers predominantly expire, as expected. -- 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]

