Skip to content

Commit

Permalink
SPARK-1801. expose InterruptibleIterator and TaskKilledException in d…
Browse files Browse the repository at this point in the history
…eveloper api
  • Loading branch information
koertkuipers committed May 13, 2014
1 parent 8586bf5 commit 8516dd2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
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
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.
*/
private[spark] class TaskKilledException extends RuntimeException
@DeveloperApi
class TaskKilledException extends RuntimeException

0 comments on commit 8516dd2

Please sign in to comment.