public class IOTraceMonitor extends IOMonitorAdapter implements Flushable
IOMonitor
logs all io reads to an
underlying IOTraceWriter
.Constructor and Description |
---|
IOTraceMonitor(@NotNull IOTraceWriter traceWriter)
Create a new instance writing to
traceWriter additional context fields context. |
IOTraceMonitor(@NotNull IOTraceWriter traceWriter,
@Nullable String contextSpec)
Create a new instance writing to
traceWriter with additional context fields. |
Modifier and Type | Method and Description |
---|---|
void |
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.
|
afterSegmentWrite, beforeSegmentRead, beforeSegmentWrite
public IOTraceMonitor(@NotNull @NotNull IOTraceWriter traceWriter, @Nullable @Nullable String contextSpec)
traceWriter
with additional context fields.traceWriter
- the IOTraceWriter
contextSpec
- additional context fields. A comma separated string.public IOTraceMonitor(@NotNull @NotNull IOTraceWriter traceWriter)
traceWriter
additional context fields context.traceWriter
- the IOTraceWriter
public void setContext(@NotNull @NotNull List<String> context)
context
- a list of strings corresponding to the fields passed to the
contextSpec
argument in the constructor.public void afterSegmentRead(@NotNull @NotNull File file, long msb, long lsb, int length, long elapsed)
IOMonitor
afterSegmentRead
in interface IOMonitor
afterSegmentRead
in class IOMonitorAdapter
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.Copyright © 2012–2020 The Apache Software Foundation. All rights reserved.