public TraceType getTraceType() { assert isTracing(); return state.get().traceType; }
public int getTTL() { assert isTracing(); return state.get().ttl; }
public UUID getSessionId() { assert isTracing(); return state.get().sessionId; }
public MessageOut(MessagingService.Verb verb, T payload, IVersionedSerializer<T> serializer) { this(verb, payload, serializer, isTracing() ? Tracing.instance.getTraceHeaders() : Collections.<String, byte[]>emptyMap()); }
public MessageOut(MessagingService.Verb verb, T payload, IVersionedSerializer<T> serializer) { this(verb, payload, serializer, isTracing() ? Tracing.instance.getTraceHeaders() : Collections.<String, byte[]>emptyMap()); }
public UUID getSessionId() { assert isTracing(); return state.get().sessionId; }
@Override public void execute(Runnable command) { super.execute(isTracing() && !(command instanceof LocalSessionWrapper) ? new LocalSessionWrapper<Object>(Executors.callable(command, null)) : command); }
@Override public void execute(Runnable command) { super.execute(isTracing() && !(command instanceof TraceSessionWrapper) ? new TraceSessionWrapper<Object>(Executors.callable(command, null)) : command); }
@Override protected <T> RunnableFuture<T> newTaskFor(Callable<T> callable) { if (isTracing() && !(callable instanceof TraceSessionWrapper)) { return new TraceSessionWrapper<T>(callable); } return super.newTaskFor(callable); }
@Override protected <T> RunnableFuture<T> newTaskFor(Callable<T> callable) { if (isTracing() && !(callable instanceof LocalSessionWrapper)) { return new LocalSessionWrapper<T>(callable); } return super.newTaskFor(callable); }
@Override protected <T> RunnableFuture<T> newTaskFor(Callable<T> callable) { if (isTracing() && !(callable instanceof LocalSessionWrapper)) { return new LocalSessionWrapper<T>(callable); } return super.newTaskFor(callable); }
public MessageOut(MessagingService.Verb verb, T payload, IVersionedSerializer<T> serializer) { this(verb, payload, serializer, isTracing() ? ImmutableMap.of(TRACE_HEADER, UUIDGen.decompose(Tracing.instance.getSessionId())) : Collections.<String, byte[]>emptyMap()); }
protected <T> FutureTask<T> newTaskFor(Callable<T> callable) { if (isTracing()) { if (callable instanceof LocalSessionFutureTask) return (LocalSessionFutureTask<T>) callable; return new LocalSessionFutureTask<T>(callable, ExecutorLocals.create()); } if (callable instanceof FutureTask) return (FutureTask<T>) callable; return new FutureTask<>(callable); }
public Map<String, byte[]> getTraceHeaders() { assert isTracing(); return ImmutableMap.of( TRACE_HEADER, UUIDGen.decompose(Tracing.instance.getSessionId()), TRACE_TYPE, new byte[] { Tracing.TraceType.serialize(Tracing.instance.getTraceType()) }); }
@Override protected <T> RunnableFuture<T> newTaskFor(Runnable runnable, T result) { if (isTracing() && !(runnable instanceof TraceSessionWrapper)) { return new TraceSessionWrapper<T>(Executors.callable(runnable, result)); } return super.newTaskFor(runnable, result); }
@Override protected <T> RunnableFuture<T> newTaskFor(Runnable runnable, T result) { if (isTracing() && !(runnable instanceof LocalSessionWrapper)) { return new LocalSessionWrapper<T>(Executors.callable(runnable, result)); } return super.newTaskFor(runnable, result); }
@Override protected <T> RunnableFuture<T> newTaskFor(Runnable runnable, T result) { if (isTracing() && !(runnable instanceof LocalSessionWrapper)) { return new LocalSessionWrapper<T>(Executors.callable(runnable, result)); } return super.newTaskFor(runnable, result); }
protected <T> FutureTask<T> newTaskFor(Callable<T> callable) { if (isTracing()) { if (callable instanceof LocalSessionFutureTask) return (LocalSessionFutureTask<T>) callable; return new LocalSessionFutureTask<T>(callable, ExecutorLocals.create()); } if (callable instanceof FutureTask) return (FutureTask<T>) callable; return new FutureTask<>(callable); }
public Map<String, byte[]> getTraceHeaders() { assert isTracing(); return ImmutableMap.of( TRACE_HEADER, UUIDGen.decompose(Tracing.instance.getSessionId()), TRACE_TYPE, new byte[] { Tracing.TraceType.serialize(Tracing.instance.getTraceType()) }); }
public Map<String, byte[]> getTraceHeaders() { assert isTracing(); return ImmutableMap.of( TRACE_HEADER, UUIDGen.decompose(Tracing.instance.getSessionId()), TRACE_TYPE, new byte[] { Tracing.TraceType.serialize(Tracing.instance.getTraceType()) }); }