code: @Override
  	public CompletableFuture<StackTraceSampleResponse> requestStackTraceSample(
  			final ExecutionAttemptID executionAttemptId,
  			final int sampleId,
  			final int numSamples,
  			final Time delayBetweenSamples,
  			final int maxStackTraceDepth,
  			final Time timeout) {
  
  		final Task task = taskSlotTable.getTask(executionAttemptId);
  		if (task == null) {
  			return FutureUtils.completedExceptionally(
  				new IllegalStateException(String.format("Cannot sample task %s. " +
  					"Task is not known to the task manager.", executionAttemptId)));
  		}
  
  		final CompletableFuture<List<StackTraceElement[]>> stackTracesFuture = stackTraceSampleService.requestStackTraceSample(
  			TaskStackTraceSampleableTaskAdapter.fromTask(task),
  			numSamples,
  			delayBetweenSamples,
  			maxStackTraceDepth);
  
  		return stackTracesFuture.thenApply(stackTraces ->
  			new StackTraceSampleResponse(sampleId, executionAttemptId, stackTraces));
  	}
docs: ======================================================================