diff --git a/core/src/main/scala/org/apache/spark/SparkContext.scala b/core/src/main/scala/org/apache/spark/SparkContext.scala index fe15052b62478dc07f9903dc0d6c8032988198ce..57d1f09f6b15b07226f97a32635babbf49173d3d 100644 --- a/core/src/main/scala/org/apache/spark/SparkContext.scala +++ b/core/src/main/scala/org/apache/spark/SparkContext.scala @@ -2011,13 +2011,23 @@ class SparkContext(config: SparkConf) extends Logging with ExecutorAllocationCli dagScheduler.cancelAllJobs() } - /** Cancel a given job if it's scheduled or running */ - private[spark] def cancelJob(jobId: Int) { + /** + * Cancel a given job if it's scheduled or running. + * + * @param jobId the job ID to cancel + * @throws InterruptedException if the cancel message cannot be sent + */ + def cancelJob(jobId: Int) { dagScheduler.cancelJob(jobId) } - /** Cancel a given stage and all jobs associated with it */ - private[spark] def cancelStage(stageId: Int) { + /** + * Cancel a given stage and all jobs associated with it. + * + * @param stageId the stage ID to cancel + * @throws InterruptedException if the cancel message cannot be sent + */ + def cancelStage(stageId: Int) { dagScheduler.cancelStage(stageId) }