/** * Check whether tracing is generally enabled. * @return true If tracing is enabled, false otherwise */ public static boolean isTracing() { return Trace.isTracing(); } }
/** * Returns whether tracing is currently on. */ public static boolean isTracing() { return org.apache.htrace.Trace.isTracing(); }
/** * Wrap the callable in a TraceCallable, if tracing. * @param callable to call * @param description description of the operation being run. If <tt>null</tt> uses the current * thread name * @return The callable provided, wrapped if tracing, 'callable' if not. */ public static <V> Callable<V> wrap(Callable<V> callable, String description) { if (Trace.isTracing()) { return new TraceCallable<V>(Trace.currentSpan(), callable, description); } return callable; }
if (Trace.isTracing()) { traceScope = Trace.startSpan("LockManager.getRowLock"); traceScope.getSpan().addTimelineAnnotation("Getting a lock");
/** * Returns whether tracing is currently on. */ public static boolean isTracing() { return org.apache.htrace.Trace.isTracing(); }
@Override public boolean next(Object info) { return Trace.isTracing(); }
/** * Wrap the callable in a TraceCallable, if tracing. * @param callable to call * @param description description of the operation being run. If <tt>null</tt> uses the current * thread name * @return The callable provided, wrapped if tracing, 'callable' if not. */ public static <V> Callable<V> wrap(Callable<V> callable, String description) { if (Trace.isTracing()) { return new TraceCallable<V>(Trace.currentSpan(), callable, description); } return callable; }
/** * Wrap the callable in a TraceCallable, if tracing. * * @param callable * @return The callable provided, wrapped if tracing, 'callable' if not. */ public static <V> Callable<V> wrap(Callable<V> callable) { if (isTracing()) { return new TraceCallable<V>(Trace.currentSpan(), callable); } else { return callable; } }
/** * Wrap the callable in a TraceCallable, if tracing. * @param callable to call * @param description description of the operation being run. If <tt>null</tt> uses the current * thread name * @return The callable provided, wrapped if tracing, 'callable' if not. */ public static <V> Callable<V> wrap(Callable<V> callable, String description) { if (Trace.isTracing()) { return new TraceCallable<V>(Trace.currentSpan(), callable, description); } return callable; }
/** * Wrap the runnable in a TraceRunnable, if tracing * * @param runnable * @return The runnable provided, wrapped if tracing, 'runnable' if not. */ public static Runnable wrap(Runnable runnable) { if (isTracing()) { return new TraceRunnable(Trace.currentSpan(), runnable); } else { return runnable; } }
/** * Wrap the runnable in a TraceRunnable, if tracing * * @param description name of the span to be created. * @param runnable * @return The runnable provided, wrapped if tracing, 'runnable' if not. */ public static Runnable wrap(String description, Runnable runnable) { if (isTracing()) { return new TraceRunnable(Trace.currentSpan(), runnable, description); } else { return runnable; } } }
public static TraceScope startSpan(String description, Sampler<TraceInfo> s, TraceInfo tinfo) { Span span = null; if (isTracing() || s.next(tinfo)) { span = new MilliSpan(description, tinfo.traceId, tinfo.spanId, random.nextLong(), Tracer.getProcessId()); } return continueSpan(span); }
public static <T> TraceScope startSpan(String description, Sampler<T> s, T info) { Span span = null; if (isTracing() || s.next(info)) { span = Tracer.getInstance().createNew(description); } return continueSpan(span); }
MemStoreScanner(long readPoint) { super(); this.readPoint = readPoint; cellSetAtCreation = cellSet; snapshotAtCreation = snapshot; if (allocator != null) { this.allocatorAtCreation = allocator; this.allocatorAtCreation.incScannerCount(); } if (snapshotAllocator != null) { this.snapshotAllocatorAtCreation = snapshotAllocator; this.snapshotAllocatorAtCreation.incScannerCount(); } if (Trace.isTracing() && Trace.currentSpan() != null) { Trace.currentSpan().addTimelineAnnotation("Creating MemStoreScanner"); } }
@Override public void requestShortCircuitShm(String clientName) throws IOException { ShortCircuitShmRequestProto.Builder builder = ShortCircuitShmRequestProto.newBuilder(). setClientName(clientName); if (Trace.isTracing()) { Span s = Trace.currentSpan(); builder.setTraceInfo(DataTransferTraceInfoProto.newBuilder() .setTraceId(s.getTraceId()).setParentId(s.getSpanId())); } ShortCircuitShmRequestProto proto = builder.build(); send(out, Op.REQUEST_SHORT_CIRCUIT_SHM, proto); }
@Override public void requestShortCircuitShm(String clientName) throws IOException { ShortCircuitShmRequestProto.Builder builder = ShortCircuitShmRequestProto.newBuilder(). setClientName(clientName); if (Trace.isTracing()) { Span s = Trace.currentSpan(); builder.setTraceInfo(DataTransferTraceInfoProto.newBuilder() .setTraceId(s.getTraceId()).setParentId(s.getSpanId())); } ShortCircuitShmRequestProto proto = builder.build(); send(out, Op.REQUEST_SHORT_CIRCUIT_SHM, proto); }
@Override public void releaseShortCircuitFds(SlotId slotId) throws IOException { ReleaseShortCircuitAccessRequestProto.Builder builder = ReleaseShortCircuitAccessRequestProto.newBuilder(). setSlotId(PBHelper.convert(slotId)); if (Trace.isTracing()) { Span s = Trace.currentSpan(); builder.setTraceInfo(DataTransferTraceInfoProto.newBuilder() .setTraceId(s.getTraceId()).setParentId(s.getSpanId())); } ReleaseShortCircuitAccessRequestProto proto = builder.build(); send(out, Op.RELEASE_SHORT_CIRCUIT_FDS, proto); }
@Override public void releaseShortCircuitFds(SlotId slotId) throws IOException { ReleaseShortCircuitAccessRequestProto.Builder builder = ReleaseShortCircuitAccessRequestProto.newBuilder(). setSlotId(PBHelper.convert(slotId)); if (Trace.isTracing()) { Span s = Trace.currentSpan(); builder.setTraceInfo(DataTransferTraceInfoProto.newBuilder() .setTraceId(s.getTraceId()).setParentId(s.getSpanId())); } ReleaseShortCircuitAccessRequestProto proto = builder.build(); send(out, Op.RELEASE_SHORT_CIRCUIT_FDS, proto); }
static BaseHeaderProto buildBaseHeader(ExtendedBlock blk, Token<BlockTokenIdentifier> blockToken) { BaseHeaderProto.Builder builder = BaseHeaderProto.newBuilder() .setBlock(PBHelper.convert(blk)) .setToken(PBHelper.convert(blockToken)); if (Trace.isTracing()) { Span s = Trace.currentSpan(); builder.setTraceInfo(DataTransferTraceInfoProto.newBuilder() .setTraceId(s.getTraceId()) .setParentId(s.getSpanId())); } return builder.build(); }
static BaseHeaderProto buildBaseHeader(ExtendedBlock blk, Token<BlockTokenIdentifier> blockToken) { BaseHeaderProto.Builder builder = BaseHeaderProto.newBuilder() .setBlock(PBHelper.convert(blk)) .setToken(PBHelper.convert(blockToken)); if (Trace.isTracing()) { Span s = Trace.currentSpan(); builder.setTraceInfo(DataTransferTraceInfoProto.newBuilder() .setTraceId(s.getTraceId()) .setParentId(s.getSpanId())); } return builder.build(); }