Class AdaptSizeTraceReader
- java.lang.Object
-
- com.github.benmanes.caffeine.cache.simulator.parser.AbstractTraceReader
-
- com.github.benmanes.caffeine.cache.simulator.parser.TextTraceReader
-
- com.github.benmanes.caffeine.cache.simulator.parser.adapt_size.AdaptSizeTraceReader
-
- All Implemented Interfaces:
TraceReader
public final class AdaptSizeTraceReader extends TextTraceReader
A reader for the trace files provided by the authors of the AdaptSize algorithm. See traces.The AdaptSize simulator treats identical keys with different weights as unique entries, rather than as an update to that entry's size. This behavior is emulated by a key hash.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.github.benmanes.caffeine.cache.simulator.parser.TraceReader
TraceReader.KeyOnlyTraceReader
-
-
Field Summary
-
Fields inherited from class com.github.benmanes.caffeine.cache.simulator.parser.AbstractTraceReader
filePath
-
-
Constructor Summary
Constructors Constructor Description AdaptSizeTraceReader(String filePath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<Policy.Characteristic>characteristics()The event features that this trace supports.Stream<AccessEvent>events()Creates a stream that lazily reads the trace source.-
Methods inherited from class com.github.benmanes.caffeine.cache.simulator.parser.TextTraceReader
lines
-
Methods inherited from class com.github.benmanes.caffeine.cache.simulator.parser.AbstractTraceReader
readFile, readInput
-
-
-
-
Constructor Detail
-
AdaptSizeTraceReader
public AdaptSizeTraceReader(String filePath)
-
-
Method Detail
-
characteristics
public Set<Policy.Characteristic> characteristics()
Description copied from interface:TraceReaderThe event features that this trace supports.
-
events
public Stream<AccessEvent> events()
Description copied from interface:TraceReaderCreates a stream that lazily reads the trace source.If timely disposal of underlying resources is required, the try-with-resources construct should be used to ensure that the stream's
closemethod is invoked after the stream operations are completed.- Returns:
- a lazy stream of cache events
-
-