juliuszsompolski commented on code in PR #41440:
URL: https://github.com/apache/spark/pull/41440#discussion_r1235018725
##########
core/src/main/scala/org/apache/spark/SparkContext.scala:
##########
@@ -829,6 +829,55 @@ class SparkContext(config: SparkConf) extends Logging {
setLocalProperty(SparkContext.SPARK_JOB_INTERRUPT_ON_CANCEL, null)
}
+ /**
+ * Set the behavior of job cancellation from jobs started in this thread.
+ *
+ * @param interruptOnCancel If true, then job cancellation will result in
`Thread.interrupt()`
+ * being called on the job's executor threads. This is useful to help ensure
that the tasks
+ * are actually stopped in a timely manner, but is off by default due to
HDFS-1208, where HDFS
+ * may respond to Thread.interrupt() by marking nodes as dead.
+ */
+ def setInterruptOnCancel(interruptOnCancel: Boolean): Unit = {
+ setLocalProperty(SparkContext.SPARK_JOB_INTERRUPT_ON_CANCEL,
interruptOnCancel.toString)
+ }
+
+ /**
+ * Add a tag to be assigned to all the jobs started by this thread.
+ *
+ * @param tagName The tag to be added. Cannot contain ',' (comma) character.
+ */
+ def addJobTag(tagName: String): Unit = {
Review Comment:
Changing to `tag`.
But I prefer the function to return Unit. The purpose of tags is in most
cases to add your tag, and not care about other tags that were already there.
While you dislike `Unit`, I dislike return values that are not used in most
cases. If someone needs to get tags, there's getJobTags for that.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]