Skip to content

Commit

Permalink
SPARK-1801. expose InterruptibleIterator and TaskKilledException in d…
Browse files Browse the repository at this point in the history
…eve...

...loper api

Author: Koert Kuipers <koert@tresata.com>

Closes apache#764 from koertkuipers/feat-rdd-developerapi and squashes the following commits:

8516dd2 [Koert Kuipers] SPARK-1801. expose InterruptibleIterator and TaskKilledException in developer api
  • Loading branch information
koertkuipers authored and aarondav committed May 14, 2014
1 parent 6ce0884 commit b22952f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@

package org.apache.spark

import org.apache.spark.annotation.DeveloperApi

/**
* :: 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
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,11 @@

package org.apache.spark

import org.apache.spark.annotation.DeveloperApi

/**
* Exception for a task getting killed.
* :: DeveloperApi ::
* 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

0 comments on commit b22952f

Please sign in to comment.