Package org.apache.accumulo.core.trace
Class TraceUtil
- java.lang.Object
-
- org.apache.accumulo.core.trace.TraceUtil
-
public class TraceUtil extends Object
Utility class for tracing within Accumulo. Not intended for client use!
-
-
Field Summary
Fields Modifier and Type Field Description static String
TRACE_HOST_PROPERTY
static String
TRACE_SERVICE_PROPERTY
static String
TRACER_ZK_HOST
static String
TRACER_ZK_PATH
static String
TRACER_ZK_TIMEOUT
-
Constructor Summary
Constructors Constructor Description TraceUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.apache.htrace.impl.CountSampler
countSampler(long frequency)
static void
disable()
Disable tracing by closing SpanReceivers for the current process.static void
enableClientTraces(String hostname, String service, Properties properties)
Enable tracing by setting up SpanReceivers for the current process.static void
enableServerTraces(String hostname, String service, AccumuloConfiguration conf)
Enable tracing by setting up SpanReceivers for the current process.static org.apache.htrace.impl.ProbabilitySampler
probabilitySampler(double fraction)
static org.apache.htrace.TraceScope
trace(TInfo info, String description)
Continue a trace by starting a new span with a given parent and description.static TInfo
traceInfo()
ObtainTInfo
for the current span.static <T> T
wrapClient(T instance)
To move trace data from client to server, the RPC call must be annotated to take a TInfo object as its first argument.static <T> T
wrapService(T instance)
-
-
-
Field Detail
-
TRACE_HOST_PROPERTY
public static final String TRACE_HOST_PROPERTY
- See Also:
- Constant Field Values
-
TRACE_SERVICE_PROPERTY
public static final String TRACE_SERVICE_PROPERTY
- See Also:
- Constant Field Values
-
TRACER_ZK_HOST
public static final String TRACER_ZK_HOST
- See Also:
- Constant Field Values
-
TRACER_ZK_TIMEOUT
public static final String TRACER_ZK_TIMEOUT
- See Also:
- Constant Field Values
-
TRACER_ZK_PATH
public static final String TRACER_ZK_PATH
- See Also:
- Constant Field Values
-
-
Method Detail
-
enableClientTraces
public static void enableClientTraces(String hostname, String service, Properties properties)
Enable tracing by setting up SpanReceivers for the current process. If host name is null, it will be determined. If service name is null, the simple name of the class will be used. Properties required in the client configuration includeClientProperty.TRACE_SPAN_RECEIVERS
and any properties specific to the span receiver.
-
enableServerTraces
public static void enableServerTraces(String hostname, String service, AccumuloConfiguration conf)
Enable tracing by setting up SpanReceivers for the current process. If host name is null, it will be determined. If service name is null, the simple name of the class will be used.
-
disable
public static void disable()
Disable tracing by closing SpanReceivers for the current process.
-
trace
public static org.apache.htrace.TraceScope trace(TInfo info, String description)
Continue a trace by starting a new span with a given parent and description.
-
countSampler
public static org.apache.htrace.impl.CountSampler countSampler(long frequency)
-
probabilitySampler
public static org.apache.htrace.impl.ProbabilitySampler probabilitySampler(double fraction)
-
wrapClient
public static <T> T wrapClient(T instance)
To move trace data from client to server, the RPC call must be annotated to take a TInfo object as its first argument. The user can simply pass null, so long as they wrap their Client and Service objects with these functions.Trace.on("remoteMethod"); Iface c = new Client(); c = TraceWrap.client(c); c.remoteMethod(null, arg2, arg3); Trace.off();
The wrapper will see the annotated method and send or re-establish the trace information. Note that the result of these calls is a Proxy object that conforms to the basic interfaces, but is not your concrete instance.
-
wrapService
public static <T> T wrapService(T instance)
-
-