Merge pull request #1309 from akka/wip-3202-deprecate-hwt-√
#3203 - deprecating HashedWheelTimer
This commit is contained in:
commit
3ee42dbe11
9 changed files with 11 additions and 4 deletions
|
|
@ -86,6 +86,7 @@ import akka.util.Unsafe;
|
|||
* cannot be queued. If no such exception is thrown, the job must be executed
|
||||
* (or returned upon stop()).
|
||||
*/
|
||||
@Deprecated
|
||||
public class HashedWheelTimer implements Timer {
|
||||
private final Worker worker = new Worker();
|
||||
final Thread workerThread;
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ package akka.util.internal;
|
|||
* @author <a href="http://gleamynode.net/">Trustin Lee</a>
|
||||
* @version $Rev: 2080 $, $Date: 2010-01-26 18:04:19 +0900 (Tue, 26 Jan 2010) $
|
||||
*/
|
||||
@Deprecated
|
||||
public interface Timeout {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ import scala.concurrent.duration.FiniteDuration;
|
|||
* @apiviz.has org.jboss.netty.util.TimerTask oneway - - executes
|
||||
* @apiviz.has org.jboss.netty.util.Timeout oneway - - creates
|
||||
*/
|
||||
@Deprecated
|
||||
public interface Timer {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ package akka.util.internal;
|
|||
* @author <a href="http://gleamynode.net/">Trustin Lee</a>
|
||||
* @version $Rev: 2080 $, $Date: 2010-01-26 18:04:19 +0900 (Tue, 26 Jan 2010) $
|
||||
*/
|
||||
@Deprecated
|
||||
public interface TimerTask {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -384,8 +384,8 @@ akka {
|
|||
|
||||
# This setting selects the timer implementation which shall be loaded at
|
||||
# system start-up. Built-in choices are:
|
||||
# - akka.actor.DefaultScheduler (HWT)
|
||||
# - akka.actor.LightArrayRevolverScheduler
|
||||
# - akka.actor.DefaultScheduler (HWT) DEPRECATED
|
||||
# (to be benchmarked and evaluated)
|
||||
# The class given here must implement the akka.actor.Scheduler interface
|
||||
# and offer a public constructor which takes three arguments:
|
||||
|
|
|
|||
|
|
@ -513,6 +513,7 @@ object LightArrayRevolverScheduler {
|
|||
* if it does not enqueue a task. Once a task is queued, it MUST be executed or
|
||||
* returned from stop().
|
||||
*/
|
||||
@deprecated("use LightArrayRevolverScheduler", "2.2")
|
||||
class DefaultScheduler(config: Config,
|
||||
log: LoggingAdapter,
|
||||
threadFactory: ThreadFactory) extends Scheduler with Closeable {
|
||||
|
|
@ -577,6 +578,7 @@ class DefaultScheduler(config: Config,
|
|||
override def maxFrequency: Double = 1.second / TickDuration
|
||||
}
|
||||
|
||||
@deprecated("use LightArrayRevolverScheduler", "2.2")
|
||||
private[akka] object ContinuousCancellable {
|
||||
private class NullHWTimeout extends HWTimeout {
|
||||
override def getTimer: HWTimer = null
|
||||
|
|
@ -602,6 +604,7 @@ private[akka] object ContinuousCancellable {
|
|||
* methods. Needed to be able to cancel continuous tasks,
|
||||
* since they create new Timeout for each tick.
|
||||
*/
|
||||
@deprecated("use LightArrayRevolverScheduler", "2.2")
|
||||
private[akka] class ContinuousCancellable extends AtomicReference[HWTimeout](ContinuousCancellable.initial) with Cancellable {
|
||||
private[akka] def init(initialTimeout: HWTimeout): this.type = {
|
||||
compareAndSet(ContinuousCancellable.initial, initialTimeout)
|
||||
|
|
@ -617,6 +620,7 @@ private[akka] class ContinuousCancellable extends AtomicReference[HWTimeout](Con
|
|||
def cancel(): Boolean = getAndSet(ContinuousCancellable.cancelled).cancel()
|
||||
}
|
||||
|
||||
@deprecated("use LightArrayRevolverScheduler", "2.2")
|
||||
private[akka] class DefaultCancellable(timeout: HWTimeout) extends AtomicReference[HWTimeout](timeout) with Cancellable {
|
||||
@tailrec final override def cancel(): Boolean = {
|
||||
get match {
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ akka {
|
|||
# If the tick-duration of the default scheduler is longer than the
|
||||
# tick-duration configured here a dedicated scheduler will be used for
|
||||
# periodic tasks of the cluster, otherwise the default scheduler is used.
|
||||
# See akka.scheduler settings for more details about the HashedWheelTimer.
|
||||
# See akka.scheduler settings for more details.
|
||||
scheduler {
|
||||
tick-duration = 33ms
|
||||
ticks-per-wheel = 512
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ import scala.collection.immutable
|
|||
import java.io.Closeable
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
import java.util.concurrent.atomic.AtomicReference
|
||||
import akka.util.internal.HashedWheelTimer
|
||||
import scala.concurrent.{ ExecutionContext, Await }
|
||||
import com.typesafe.config.ConfigFactory
|
||||
import akka.remote.DefaultFailureDetectorRegistry
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ trait Conductor { this: TestConductorExt ⇒
|
|||
* according to the given rate, the previous packet completion and the current
|
||||
* packet length. In case of large packets they are split up if the calculated
|
||||
* send pause would exceed `akka.testconductor.packet-split-threshold`
|
||||
* (roughly). All of this uses the system’s HashedWheelTimer, which is not
|
||||
* (roughly). All of this uses the system’s scheduler, which is not
|
||||
* terribly precise and will execute tasks later than they are schedule (even
|
||||
* on average), but that is countered by using the actual execution time for
|
||||
* determining how much to send, leading to the correct output rate, but with
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue