Class TraceUtil


  • public class TraceUtil
    extends Object
    Utility class for tracing within Accumulo. Not intended for client use!
    • Constructor Detail

      • TraceUtil

        public TraceUtil()
    • 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 include ClientProperty.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.
      • traceInfo

        public static TInfo traceInfo()
        Obtain TInfo for the current span.
      • 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)