Class PolicyActor
- java.lang.Object
-
- com.github.benmanes.caffeine.cache.simulator.policy.PolicyActor
-
public final class PolicyActor extends Object
An actor that proxies to the page replacement policy.
-
-
Constructor Summary
Constructors Constructor Description PolicyActor(Thread parent, Policy policy, BasicSettings settings)Creates an actor that executes the policy actions asynchronously over a buffered channel.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletableFuture<Void>finish()Sends a shutdown signal after the pending messages are completed and blocks until done.voidsend(List<AccessEvent> events)Sends the access events for async processing and blocks until accepted into the mailbox.PolicyStatsstats()Returns the cache efficiency statistics.
-
-
-
Constructor Detail
-
PolicyActor
public PolicyActor(Thread parent, Policy policy, BasicSettings settings)
Creates an actor that executes the policy actions asynchronously over a buffered channel.- Parameters:
parent- the supervisor to interrupt if the policy failspolicy- the cache policy being simulatedsettings- the simulation settings
-
-
Method Detail
-
send
public void send(List<AccessEvent> events)
Sends the access events for async processing and blocks until accepted into the mailbox.
-
finish
public CompletableFuture<Void> finish()
Sends a shutdown signal after the pending messages are completed and blocks until done.
-
stats
public PolicyStats stats()
Returns the cache efficiency statistics.
-
-