Class IOTraceMonitor
java.lang.Object
org.apache.jackrabbit.oak.segment.spi.monitor.IOMonitorAdapter
org.apache.jackrabbit.oak.segment.tool.iotrace.IOTraceMonitor
This implementation of a
IOMonitor
logs all io reads to an
underlying IOTraceWriter
.-
Constructor Summary
ConstructorsConstructorDescriptionIOTraceMonitor
(@NotNull IOTraceWriter traceWriter) Create a new instance writing totraceWriter
additional context fields context.IOTraceMonitor
(@NotNull IOTraceWriter traceWriter, @Nullable String contextSpec) Create a new instance writing totraceWriter
with additional context fields. -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterSegmentRead
(@NotNull File file, long msb, long lsb, int length, long elapsed) Called after a segment is read from the file system.void
flush()
void
setContext
(@NotNull List<String> context) Set the current context.Methods inherited from class org.apache.jackrabbit.oak.segment.spi.monitor.IOMonitorAdapter
afterSegmentWrite, beforeSegmentRead, beforeSegmentWrite
-
Constructor Details
-
IOTraceMonitor
public IOTraceMonitor(@NotNull @NotNull IOTraceWriter traceWriter, @Nullable @Nullable String contextSpec) Create a new instance writing totraceWriter
with additional context fields.- Parameters:
traceWriter
- theIOTraceWriter
contextSpec
- additional context fields. A comma separated string.
-
IOTraceMonitor
Create a new instance writing totraceWriter
additional context fields context.- Parameters:
traceWriter
- theIOTraceWriter
-
-
Method Details
-
setContext
Set the current context.- Parameters:
context
- a list of strings corresponding to the fields passed to thecontextSpec
argument in the constructor.
-
afterSegmentRead
public void afterSegmentRead(@NotNull @NotNull File file, long msb, long lsb, int length, long elapsed) Description copied from interface:IOMonitor
Called after a segment is read from the file system. This is called only in case of successful operations.- Specified by:
afterSegmentRead
in interfaceIOMonitor
- Overrides:
afterSegmentRead
in classIOMonitorAdapter
- Parameters:
file
- File containing the segment.msb
- Most significant bits of the segment ID.lsb
- Least significant bits of the segment ID.length
- Size of the segment.elapsed
- Time spent by the read operation, in nanoseconds.
-
flush
public void flush()
-