private void setupContext() { Tracing.instance.set(state); }
private void reset() { Tracing.instance.set(null); } }
/** This method is intended to be overridden in tracing implementations that need access to the customPayload */ protected UUID newSession(UUID sessionId, TraceType traceType, Map<String,ByteBuffer> customPayload) { assert get() == null; TraceState ts = newTraceState(localAddress, sessionId, traceType); set(ts); sessions.put(sessionId, ts); return sessionId; }
/** This method is intended to be overridden in tracing implementations that need access to the customPayload */ protected UUID newSession(UUID sessionId, TraceType traceType, Map<String,ByteBuffer> customPayload) { assert get() == null; TraceState ts = newTraceState(localAddress, sessionId, traceType); set(ts); sessions.put(sessionId, ts); return sessionId; }
/** This method is intended to be overridden in tracing implementations that need access to the customPayload */ protected UUID newSession(UUID sessionId, TraceType traceType, Map<String,ByteBuffer> customPayload) { assert get() == null; TraceState ts = newTraceState(localAddress, sessionId, traceType); set(ts); sessions.put(sessionId, ts); return sessionId; }
/** * Stop the session and record its complete. Called by coodinator when request is complete. */ public void stopSession() { TraceState state = get(); if (state == null) // inline isTracing to avoid implicit two calls to state.get() { logger.trace("request complete"); } else { stopSessionImpl(); state.stop(); sessions.remove(state.sessionId); set(null); } }
/** * Stop the session and record its complete. Called by coodinator when request is complete. */ public void stopSession() { TraceState state = get(); if (state == null) // inline isTracing to avoid implicit two calls to state.get() { logger.trace("request complete"); } else { stopSessionImpl(); state.stop(); sessions.remove(state.sessionId); set(null); } }
/** * Stop the session and record its complete. Called by coodinator when request is complete. */ public void stopSession() { TraceState state = get(); if (state == null) // inline isTracing to avoid implicit two calls to state.get() { logger.trace("request complete"); } else { stopSessionImpl(); state.stop(); sessions.remove(state.sessionId); set(null); } }
private void repairComplete() { String duration = DurationFormatUtils.formatDurationWords(System.currentTimeMillis() - startTime, true, true); String message = String.format("Repair command #%d finished in %s", cmd, duration); fireProgressEvent(tag, new ProgressEvent(ProgressEventType.COMPLETE, progress.get(), totalProgress, message)); logger.info(message); if (options.isTraced() && traceState != null) { for (ProgressListener listener : listeners) traceState.removeProgressListener(listener); // Because DebuggableThreadPoolExecutor#afterExecute and this callback // run in a nondeterministic order (within the same thread), the // TraceState may have been nulled out at this point. The TraceState // should be traceState, so just set it without bothering to check if it // actually was nulled out. Tracing.instance.set(traceState); Tracing.traceRepair(message); Tracing.instance.stopSession(); } executor.shutdownNow(); } });
private void repairComplete() { String duration = DurationFormatUtils.formatDurationWords(System.currentTimeMillis() - startTime, true, true); String message = String.format("Repair command #%d finished in %s", cmd, duration); fireProgressEvent(tag, new ProgressEvent(ProgressEventType.COMPLETE, progress.get(), totalProgress, message)); logger.info(message); if (options.isTraced() && traceState != null) { for (ProgressListener listener : listeners) traceState.removeProgressListener(listener); // Because DebuggableThreadPoolExecutor#afterExecute and this callback // run in a nondeterministic order (within the same thread), the // TraceState may have been nulled out at this point. The TraceState // should be traceState, so just set it without bothering to check if it // actually was nulled out. Tracing.instance.set(traceState); Tracing.traceRepair(message); Tracing.instance.stopSession(); } executor.shutdownNow(); } });
private void repairComplete() { String duration = DurationFormatUtils.formatDurationWords(System.currentTimeMillis() - startTime, true, true); String message = String.format("Repair command #%d finished in %s", cmd, duration); fireProgressEvent(tag, new ProgressEvent(ProgressEventType.COMPLETE, progress.get(), totalProgress, message)); logger.info(message); if (options.isTraced() && traceState != null) { for (ProgressListener listener : listeners) traceState.removeProgressListener(listener); // Because DebuggableThreadPoolExecutor#afterExecute and this callback // run in a nondeterministic order (within the same thread), the // TraceState may have been nulled out at this point. The TraceState // should be traceState, so just set it without bothering to check if it // actually was nulled out. Tracing.instance.set(traceState); Tracing.traceRepair(message); Tracing.instance.stopSession(); } executor.shutdownNow(); } });