Package org.apache.accumulo.core.trace
Class Trace
- java.lang.Object
-
- org.apache.accumulo.core.trace.Trace
-
public class Trace extends Object
Utility class for tracing within Accumulo. Not intended for client use!
-
-
Constructor Summary
Constructors Constructor Description Trace()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static Span
currentTrace()
Deprecated.since 1.7 -- it is better to save the span you create in a local variable and call its methods, rather than retrieving the current spanstatic long
currentTraceId()
Get the trace id of the current span.static void
data(String k, String v)
Add data to the current span.static boolean
isTracing()
Returns whether tracing is currently on.static void
off()
Finish the current trace.static void
offNoFlush()
Deprecated.since 1.7, useoff()
insteadstatic Span
on(String description)
Start a trace span with a given description.static <T> Span
on(String description, org.apache.htrace.Sampler<T> sampler)
Start a trace span with a given description with the given sampler.static Span
start(String description)
Start a new span with a given name, if already tracing.static Span
trace(TInfo info, String description)
Continue a trace by starting a new span with a given parent and description.static Runnable
wrap(Runnable runnable)
Wrap a runnable in a TraceRunnable, if tracing.static <T> T
wrapAll(T instance)
static <T,V>
TwrapAll(T instance, org.apache.htrace.Sampler<V> dist)
-
-
-
Method Detail
-
on
public static <T> Span on(String description, org.apache.htrace.Sampler<T> sampler)
Start a trace span with a given description with the given sampler.
-
off
public static void off()
Finish the current trace.
-
offNoFlush
@Deprecated public static void offNoFlush()
Deprecated.since 1.7, useoff()
instead
-
isTracing
public static boolean isTracing()
Returns whether tracing is currently on.
-
currentTrace
@Deprecated public static Span currentTrace()
Deprecated.since 1.7 -- it is better to save the span you create in a local variable and call its methods, rather than retrieving the current spanReturn the current span.
-
currentTraceId
public static long currentTraceId()
Get the trace id of the current span.
-
start
public static Span start(String description)
Start a new span with a given name, if already tracing.
-
trace
public static Span trace(TInfo info, String description)
Continue a trace by starting a new span with a given parent and description.
-
wrap
public static Runnable wrap(Runnable runnable)
Wrap a runnable in a TraceRunnable, if tracing.
-
wrapAll
public static <T> T wrapAll(T instance)
-
wrapAll
public static <T,V> T wrapAll(T instance, org.apache.htrace.Sampler<V> dist)
-
-