Class BinaryTraceReader
- java.lang.Object
-
- com.github.benmanes.caffeine.cache.simulator.parser.AbstractTraceReader
-
- com.github.benmanes.caffeine.cache.simulator.parser.BinaryTraceReader
-
- All Implemented Interfaces:
TraceReader
- Direct Known Subclasses:
Cache2kTraceReader
,CloudPhysicsTraceReader
,CordaTraceReader
,GLCacheTraceReader
,ScarabTraceReader
public abstract class BinaryTraceReader extends AbstractTraceReader
A skeletal implementation that reads the trace file as binary data.
-
-
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 Modifier Constructor Description protected
BinaryTraceReader(String filePath)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Stream<AccessEvent>
events()
Creates a stream that lazily reads the trace source.protected abstract AccessEvent
readEvent(DataInputStream input)
Returns the next event from the input stream.-
Methods inherited from class com.github.benmanes.caffeine.cache.simulator.parser.AbstractTraceReader
readFile, readInput
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.github.benmanes.caffeine.cache.simulator.parser.TraceReader
characteristics
-
-
-
-
Constructor Detail
-
BinaryTraceReader
protected BinaryTraceReader(String filePath)
-
-
Method Detail
-
events
public Stream<AccessEvent> events()
Description copied from interface:TraceReader
Creates 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
close
method is invoked after the stream operations are completed.- Returns:
- a lazy stream of cache events
-
readEvent
protected abstract AccessEvent readEvent(DataInputStream input) throws IOException
Returns the next event from the input stream.- Throws:
IOException
-
-