Github user JoshRosen commented on a diff in the pull request:
https://github.com/apache/spark/pull/4135#discussion_r28022977
--- Diff: core/src/main/scala/org/apache/spark/TaskContext.scala ---
@@ -106,6 +105,20 @@ abstract class TaskContext extends Serializable {
def addOnCompleteCallback(f: () => Unit)
/**
+ * Add a (Java friendly) listener to be executed on task interruption.
We add this
+ * listener for some more clean works. An example use is to stop
`receiver supervisor`
+ * properly.
+ */
+ def addTaskInterruptionListener(listener: TaskInterruptionListener):
TaskContext
+
+ /**
+ * Add a listener in the form of a Scala closure to be executed on task
interruption.
+ * We add this listener for some more clean works. An example use is to
stop `receiver
--- End diff --
I'd reword this slightly to be a bit more explicit:
> Add a listener in the form of a Scala closure to be executed on task
interruption. An example use is to cleanly shut down long-running receiver
tasks in Spark Streaming.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]