Class IOTraceMonitor
- java.lang.Object
-
- org.apache.jackrabbit.oak.segment.spi.monitor.IOMonitorAdapter
-
- org.apache.jackrabbit.oak.segment.tool.iotrace.IOTraceMonitor
-
public class IOTraceMonitor extends IOMonitorAdapter implements Flushable
This implementation of aIOMonitorlogs all io reads to an underlyingIOTraceWriter.
-
-
Constructor Summary
Constructors Constructor Description IOTraceMonitor(@NotNull IOTraceWriter traceWriter)Create a new instance writing totraceWriteradditional context fields context.IOTraceMonitor(@NotNull IOTraceWriter traceWriter, @Nullable String contextSpec)Create a new instance writing totraceWriterwith additional context fields.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterSegmentRead(@NotNull File file, long msb, long lsb, int length, long elapsed)Called after a segment is read from the file system.voidflush()voidsetContext(@NotNull List<String> context)Set the current context.-
Methods inherited from class org.apache.jackrabbit.oak.segment.spi.monitor.IOMonitorAdapter
afterSegmentWrite, beforeSegmentRead, beforeSegmentWrite
-
-
-
-
Constructor Detail
-
IOTraceMonitor
public IOTraceMonitor(@NotNull @NotNull IOTraceWriter traceWriter, @Nullable @Nullable String contextSpec)Create a new instance writing totraceWriterwith additional context fields.- Parameters:
traceWriter- theIOTraceWritercontextSpec- additional context fields. A comma separated string.
-
IOTraceMonitor
public IOTraceMonitor(@NotNull @NotNull IOTraceWriter traceWriter)Create a new instance writing totraceWriteradditional context fields context.- Parameters:
traceWriter- theIOTraceWriter
-
-
Method Detail
-
setContext
public void setContext(@NotNull @NotNull List<String> context)Set the current context.- Parameters:
context- a list of strings corresponding to the fields passed to thecontextSpecargument in the constructor.
-
afterSegmentRead
public void afterSegmentRead(@NotNull @NotNull File file, long msb, long lsb, int length, long elapsed)Description copied from interface:IOMonitorCalled after a segment is read from the file system. This is called only in case of successful operations.- Specified by:
afterSegmentReadin interfaceIOMonitor- Overrides:
afterSegmentReadin 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.
-
-