Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPARK-1801. expose InterruptibleIterator and TaskKilledException in deve... #764

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@

package org.apache.spark

import org.apache.spark.annotation.DeveloperApi

/**
* An iterator that wraps around an existing iterator to provide task killing functionality.
* It works by checking the interrupted flag in [[TaskContext]].
*/
private[spark] class InterruptibleIterator[+T](val context: TaskContext, val delegate: Iterator[T])
@DeveloperApi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to a bug in scaladoc, we also need to add ":: DeveloperApi ::" on the line immediately preceding the first line of comments.

class InterruptibleIterator[+T](val context: TaskContext, val delegate: Iterator[T])
extends Iterator[T] {

def hasNext: Boolean = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@

package org.apache.spark

import org.apache.spark.annotation.DeveloperApi

/**
* Exception for a task getting killed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're exposing this API, perhaps we could add a bit more to the comment, like "Exception thrown when a task is explicitly killed (i.e., task failure is expected)."

*/
private[spark] class TaskKilledException extends RuntimeException
@DeveloperApi
class TaskKilledException extends RuntimeException