class_docstr: A client that is scoped to a specific job.
  
  .. versionadded:: 1.11.0
docstr: Stops the associated job on Flink cluster.
  
  Stopping works only for streaming programs. Be aware, that the job might continue to run
  for a while after sending the stop command, because after sources stopped to emit data all
  operators need to finish processing.
  
  :param advance_to_end_of_event_time: Flag indicating if the source should inject a
                                       MAX_WATERMARK in the pipeline.
  :param savepoint_directory: Directory the savepoint should be written to.
  :return: A CompletableFuture containing the path where the savepoint is located.
  
  .. versionadded:: 1.11.0
docstr_tok: ["Stops","the","associated","job","on","Flink","cluster",".","Stopping","works","only","for","streaming","programs",".","Be","aware",",","that","the","job","might","continue","to","run","for","a","while","after","sending","the","stop","command",",","because","after","sources","stopped","to","emit","data","all","operators","need","to","finish","processing",".",":","param","advance_to_end_of_event_time",":","Flag","indicating","if","the","source","should","inject","a","MAX_WATERMARK","in","the","pipeline",".",":","param","savepoint_directory",":","Directory","the","savepoint","should","be","written","to",".",":","return",":","A","CompletableFuture","containing","the","path","where","the","savepoint","is","located",".","..","versionadded",":",":","1.11.0"]
code: def stop_with_savepoint(
      self,
      advance_to_end_of_event_time: bool,
      savepoint_directory: str = None,
  ) -> CompletableFuture:
      """
      Stops the associated job on Flink cluster.
  
      Stopping works only for streaming programs. Be aware, that the job might continue to run
      for a while after sending the stop command, because after sources stopped to emit data all
      operators need to finish processing.
  
      :param advance_to_end_of_event_time: Flag indicating if the source should inject a
                                           MAX_WATERMARK in the pipeline.
      :param savepoint_directory: Directory the savepoint should be written to.
      :return: A CompletableFuture containing the path where the savepoint is located.
  
      .. versionadded:: 1.11.0
      """
      return CompletableFuture(
          self._j_job_client.stopWithSavepoint(
              advance_to_end_of_event_time, savepoint_directory
          ),
          str,
      )
  
file_path: flink/flink-python/pyflink/common/job_client.py
imports: from pyflink.common.completable_future import CompletableFuture
  from pyflink.common.job_execution_result import JobExecutionResult
  from pyflink.common.job_id import JobID
  from pyflink.common.job_status import JobStatus
label_desc: Use image node_id 5 for calling the JobClient obj's underlying member method code with example usage: obj.stop_with_savepoint(advance_to_end_of_event_time, savepoint_directory) and returns: CompletableFuture