test_class.declarator: system
test_class.modifier: private static
test_class.original_string: private static ActorSystem system;
test_class.type: ActorSystem
test_class.var_name: system
test_class.declarator: coord
test_class.modifier: private
test_class.original_string: private StackTraceSampleCoordinator coord;
test_class.type: StackTraceSampleCoordinator
test_class.var_name: coord
test_class.file: flink-runtime-web/src/test/java/org/apache/flink/runtime/webmonitor/StackTraceSampleCoordinatorTest.java
test_class.identifier: StackTraceSampleCoordinatorTest
test_case.body: @Test
  	public void testCancelStackTraceSample() throws Exception {
  		ExecutionVertex[] vertices = new ExecutionVertex[] {
  				mockExecutionVertex(new ExecutionAttemptID(), ExecutionState.RUNNING, true),
  		};
  
  		Future<StackTraceSample> sampleFuture = coord.triggerStackTraceSample(
  				vertices, 1, new FiniteDuration(100, TimeUnit.MILLISECONDS), 0);
  
  		assertFalse(sampleFuture.isCompleted());
  
  		// Cancel
  		coord.cancelStackTraceSample(0, null);
  
  		// Verify completed
  		assertTrue(sampleFuture.isCompleted());
  
  		// Verify no more pending samples
  		assertEquals(0, coord.getNumberOfPendingSamples());
  	}
test_case.class_method_signature: StackTraceSampleCoordinatorTest.testCancelStackTraceSample()
test_case.full_signature: @Test public void testCancelStackTraceSample()
test_case.identifier: testCancelStackTraceSample
test_case.invocations: mockExecutionVertex triggerStackTraceSample assertFalse isCompleted cancelStackTraceSample assertTrue isCompleted assertEquals getNumberOfPendingSamples
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCancelStackTraceSample()
focal_class.declarator: LOG = LoggerFactory.getLogger(StackTraceSampleCoordinator.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(StackTraceSampleCoordinator.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: NUM_GHOST_SAMPLE_IDS = 10
focal_class.modifier: private static final
focal_class.original_string: private static final int NUM_GHOST_SAMPLE_IDS = 10;
focal_class.type: int
focal_class.var_name: NUM_GHOST_SAMPLE_IDS
focal_class.declarator: lock = new Object()
focal_class.modifier: private final
focal_class.original_string: private final Object lock = new Object();
focal_class.type: Object
focal_class.var_name: lock
focal_class.declarator: responseActor
focal_class.modifier: private final
focal_class.original_string: private final ActorGateway responseActor;
focal_class.type: ActorGateway
focal_class.var_name: responseActor
focal_class.declarator: sampleTimeout
focal_class.modifier: private final
focal_class.original_string: private final int sampleTimeout;
focal_class.type: int
focal_class.var_name: sampleTimeout
focal_class.declarator: pendingSamples = new HashMap<>()
focal_class.modifier: private final
focal_class.original_string: private final Map<Integer, PendingStackTraceSample> pendingSamples = new HashMap<>();
focal_class.type: Map<Integer, PendingStackTraceSample>
focal_class.var_name: pendingSamples
focal_class.declarator: recentPendingSamples = new ArrayDeque<>(NUM_GHOST_SAMPLE_IDS)
focal_class.modifier: private final
focal_class.original_string: private final ArrayDeque<Integer> recentPendingSamples = new ArrayDeque<>(NUM_GHOST_SAMPLE_IDS);
focal_class.type: ArrayDeque<Integer>
focal_class.var_name: recentPendingSamples
focal_class.declarator: sampleIdCounter
focal_class.modifier: private
focal_class.original_string: private int sampleIdCounter;
focal_class.type: int
focal_class.var_name: sampleIdCounter
focal_class.declarator: timer
focal_class.modifier: private
focal_class.original_string: private Timer timer;
focal_class.type: Timer
focal_class.var_name: timer
focal_class.declarator: isShutDown
focal_class.modifier: private
focal_class.original_string: private boolean isShutDown;
focal_class.type: boolean
focal_class.var_name: isShutDown
focal_class.file: flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/StackTraceSampleCoordinator.java
focal_class.identifier: StackTraceSampleCoordinator
focal_class.class_method_signature: StackTraceSampleCoordinator.StackTraceSampleCoordinator(ActorSystem actorSystem, int sampleTimeout)
focal_class.full_signature: public  StackTraceSampleCoordinator(ActorSystem actorSystem, int sampleTimeout)
focal_class.identifier: StackTraceSampleCoordinator
focal_class.modifiers: public
focal_class.parameters: (ActorSystem actorSystem, int sampleTimeout)
focal_class.signature:  StackTraceSampleCoordinator(ActorSystem actorSystem, int sampleTimeout)
focal_class.class_method_signature: StackTraceSampleCoordinator.triggerStackTraceSample(
  			ExecutionVertex[] tasksToSample,
  			int numSamples,
  			FiniteDuration delayBetweenSamples,
  			int maxStackTraceDepth)
focal_class.full_signature: @SuppressWarnings("unchecked") public Future<StackTraceSample> triggerStackTraceSample(
  			ExecutionVertex[] tasksToSample,
  			int numSamples,
  			FiniteDuration delayBetweenSamples,
  			int maxStackTraceDepth)
focal_class.identifier: triggerStackTraceSample
focal_class.modifiers: @SuppressWarnings("unchecked") public
focal_class.parameters: (
  			ExecutionVertex[] tasksToSample,
  			int numSamples,
  			FiniteDuration delayBetweenSamples,
  			int maxStackTraceDepth)
focal_class.return: Future<StackTraceSample>
focal_class.signature: Future<StackTraceSample> triggerStackTraceSample(
  			ExecutionVertex[] tasksToSample,
  			int numSamples,
  			FiniteDuration delayBetweenSamples,
  			int maxStackTraceDepth)
focal_class.class_method_signature: StackTraceSampleCoordinator.cancelStackTraceSample(int sampleId, Exception cause)
focal_class.full_signature: public void cancelStackTraceSample(int sampleId, Exception cause)
focal_class.identifier: cancelStackTraceSample
focal_class.modifiers: public
focal_class.parameters: (int sampleId, Exception cause)
focal_class.return: void
focal_class.signature: void cancelStackTraceSample(int sampleId, Exception cause)
focal_class.class_method_signature: StackTraceSampleCoordinator.shutDown()
focal_class.full_signature: public void shutDown()
focal_class.identifier: shutDown
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void shutDown()
focal_class.class_method_signature: StackTraceSampleCoordinator.collectStackTraces(
  			int sampleId,
  			ExecutionAttemptID executionId,
  			List<StackTraceElement[]> stackTraces)
focal_class.full_signature: public void collectStackTraces(
  			int sampleId,
  			ExecutionAttemptID executionId,
  			List<StackTraceElement[]> stackTraces)
focal_class.identifier: collectStackTraces
focal_class.modifiers: public
focal_class.parameters: (
  			int sampleId,
  			ExecutionAttemptID executionId,
  			List<StackTraceElement[]> stackTraces)
focal_class.return: void
focal_class.signature: void collectStackTraces(
  			int sampleId,
  			ExecutionAttemptID executionId,
  			List<StackTraceElement[]> stackTraces)
focal_class.class_method_signature: StackTraceSampleCoordinator.rememberRecentSampleId(int sampleId)
focal_class.full_signature: private void rememberRecentSampleId(int sampleId)
focal_class.identifier: rememberRecentSampleId
focal_class.modifiers: private
focal_class.parameters: (int sampleId)
focal_class.return: void
focal_class.signature: void rememberRecentSampleId(int sampleId)
focal_class.class_method_signature: StackTraceSampleCoordinator.getNumberOfPendingSamples()
focal_class.full_signature:  int getNumberOfPendingSamples()
focal_class.identifier: getNumberOfPendingSamples
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getNumberOfPendingSamples()
focal_method.body: public void cancelStackTraceSample(int sampleId, Exception cause) {
  		synchronized (lock) {
  			if (isShutDown) {
  				return;
  			}
  
  			PendingStackTraceSample sample = pendingSamples.remove(sampleId);
  			if (sample != null) {
  				if (cause != null) {
  					LOG.info("Cancelling sample " + sampleId, cause);
  				} else {
  					LOG.info("Cancelling sample {}", sampleId);
  				}
  
  				sample.discard(cause);
  				rememberRecentSampleId(sampleId);
  			}
  		}
  	}
focal_method.class_method_signature: StackTraceSampleCoordinator.cancelStackTraceSample(int sampleId, Exception cause)
focal_method.full_signature: public void cancelStackTraceSample(int sampleId, Exception cause)
focal_method.identifier: cancelStackTraceSample
focal_method.invocations: remove info info discard rememberRecentSampleId
focal_method.modifiers: public
focal_method.parameters: (int sampleId, Exception cause)
focal_method.return: void
focal_method.signature: void cancelStackTraceSample(int sampleId, Exception cause)