public class IOTracer extends Object
An instance of Trace
is used to specify a read pattern. Segment reads
are recorded in CSV format:
timestamp,file,segmentId,length,elapsed 1522147945084,data01415a.tar,f81378df-b3f8-4b25-0000-00000002c450,181328,171849 1522147945096,data01415a.tar,f81378df-b3f8-4b25-0000-00000002c450,181328,131272 1522147945097,data01415a.tar,f81378df-b3f8-4b25-0000-00000002c450,181328,142766 ...
Trace
implementations can specify an additional context, which is recorded
with each line of the CSV output. A context is simply a list of additional fields
as specified during instantiation of an IOTracer
.Modifier and Type | Method and Description |
---|---|
void |
collectTrace(@NotNull Trace trace)
Collect a IO trace.
|
static @NotNull IOTracer |
newIOTracer(@NotNull Function<IOMonitor,FileStore> fileStoreFactory,
@NotNull Writer output,
@Nullable String contextSpec)
Create a new
IOTracer instance. |
void |
setContext(@NotNull List<String> context)
Set the
context to be added to each line of the IOTrace going forward. |
@NotNull public static @NotNull IOTracer newIOTracer(@NotNull @NotNull Function<IOMonitor,FileStore> fileStoreFactory, @NotNull @NotNull Writer output, @Nullable @Nullable String contextSpec)
IOTracer
instance.fileStoreFactory
- A factory for creating a FileStore
with the
passed IOMonitor
for monitoring segment IO.output
- The target for the CSV formatted IO trace.contextSpec
- The specification of additional context provided by
the traces
being run
.
A trace consists of a comma separated list of values, which must match
the list of values passed to setContext(List)
.IOTracer
instance.public void collectTrace(@NotNull @NotNull Trace trace)
trace
- public void setContext(@NotNull @NotNull List<String> context)
context
to be added to each line of the IOTrace going forward. The list
of values needs to match the context specification passed to
newIOTracer(Function, Writer, String)
.context
- Copyright © 2012–2020 The Apache Software Foundation. All rights reserved.