Packages

c

org.apache.spark

ContextAwareIterator

class ContextAwareIterator[+T] extends Iterator[T]

:: DeveloperApi :: A TaskContext aware iterator.

As the Python evaluation consumes the parent iterator in a separate thread, it could consume more data from the parent even after the task ends and the parent is closed. If an off-heap access exists in the parent iterator, it could cause segmentation fault which crashes the executor. Thus, we should use ContextAwareIterator to stop consuming after the task ends.

Annotations
@DeveloperApi() @deprecated
Deprecated

(Since version 4.0.0) Only usage for Python evaluation is now extinct

Source
ContextAwareIterator.scala
Since

3.1.0

Linear Supertypes
Iterator[T], IterableOnceOps[T, Iterator, Iterator[T]], IterableOnce[T], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ContextAwareIterator
  2. Iterator
  3. IterableOnceOps
  4. IterableOnce
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new ContextAwareIterator(context: TaskContext, delegate: Iterator[T])

    Deprecated

    since 4.0.0 as its only usage for Python evaluation is now extinct

Type Members

  1. class GroupedIterator[B >: A] extends AbstractIterator[Seq[B]]
    Definition Classes
    Iterator

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ++[B >: T](xs: => IterableOnce[B]): Iterator[B]
    Definition Classes
    Iterator
    Annotations
    @inline()
  4. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  5. final def addString(b: StringBuilder): b.type
    Definition Classes
    IterableOnceOps
    Annotations
    @inline()
  6. final def addString(b: StringBuilder, sep: String): b.type
    Definition Classes
    IterableOnceOps
    Annotations
    @inline()
  7. def addString(b: StringBuilder, start: String, sep: String, end: String): b.type
    Definition Classes
    IterableOnceOps
  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. def buffered: BufferedIterator[T]
    Definition Classes
    Iterator
  10. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  11. def collect[B](pf: PartialFunction[T, B]): Iterator[B]
    Definition Classes
    Iterator → IterableOnceOps
  12. def collectFirst[B](pf: PartialFunction[T, B]): Option[B]
    Definition Classes
    IterableOnceOps
  13. def concat[B >: T](xs: => IterableOnce[B]): Iterator[B]
    Definition Classes
    Iterator
  14. def contains(elem: Any): Boolean
    Definition Classes
    Iterator
  15. val context: TaskContext
  16. def copyToArray[B >: T](xs: Array[B], start: Int, len: Int): Int
    Definition Classes
    IterableOnceOps
  17. def copyToArray[B >: T](xs: Array[B], start: Int): Int
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecatedOverriding()
  18. def copyToArray[B >: T](xs: Array[B]): Int
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecatedOverriding()
  19. def corresponds[B](that: IterableOnce[B])(p: (T, B) => Boolean): Boolean
    Definition Classes
    IterableOnceOps
  20. def count(p: (T) => Boolean): Int
    Definition Classes
    IterableOnceOps
  21. val delegate: Iterator[T]
  22. def distinct: Iterator[T]
    Definition Classes
    Iterator
  23. def distinctBy[B](f: (T) => B): Iterator[T]
    Definition Classes
    Iterator
  24. def drop(n: Int): Iterator[T]
    Definition Classes
    Iterator → IterableOnceOps
  25. def dropWhile(p: (T) => Boolean): Iterator[T]
    Definition Classes
    Iterator → IterableOnceOps
  26. def duplicate: (Iterator[T], Iterator[T])
    Definition Classes
    Iterator
  27. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  28. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  29. def exists(p: (T) => Boolean): Boolean
    Definition Classes
    IterableOnceOps
  30. def filter(p: (T) => Boolean): Iterator[T]
    Definition Classes
    Iterator → IterableOnceOps
  31. def filterNot(p: (T) => Boolean): Iterator[T]
    Definition Classes
    Iterator → IterableOnceOps
  32. def find(p: (T) => Boolean): Option[T]
    Definition Classes
    IterableOnceOps
  33. def flatMap[B](f: (T) => IterableOnce[B]): Iterator[B]
    Definition Classes
    Iterator → IterableOnceOps
  34. def flatten[B](implicit ev: (T) => IterableOnce[B]): Iterator[B]
    Definition Classes
    Iterator → IterableOnceOps
  35. def fold[A1 >: T](z: A1)(op: (A1, A1) => A1): A1
    Definition Classes
    IterableOnceOps
  36. def foldLeft[B](z: B)(op: (B, T) => B): B
    Definition Classes
    IterableOnceOps
  37. def foldRight[B](z: B)(op: (T, B) => B): B
    Definition Classes
    IterableOnceOps
  38. def forall(p: (T) => Boolean): Boolean
    Definition Classes
    IterableOnceOps
  39. def foreach[U](f: (T) => U): Unit
    Definition Classes
    IterableOnceOps
  40. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  41. def grouped[B >: T](size: Int): GroupedIterator[B]
    Definition Classes
    Iterator
  42. def hasNext: Boolean
    Definition Classes
    ContextAwareIterator → Iterator
  43. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  44. def indexOf[B >: T](elem: B, from: Int): Int
    Definition Classes
    Iterator
  45. def indexOf[B >: T](elem: B): Int
    Definition Classes
    Iterator
  46. def indexWhere(p: (T) => Boolean, from: Int): Int
    Definition Classes
    Iterator
  47. def isEmpty: Boolean
    Definition Classes
    Iterator → IterableOnceOps
    Annotations
    @deprecatedOverriding()
  48. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  49. def isTraversableAgain: Boolean
    Definition Classes
    IterableOnceOps
  50. final def iterator: Iterator[T]
    Definition Classes
    Iterator → IterableOnce
    Annotations
    @inline()
  51. def knownSize: Int
    Definition Classes
    IterableOnce
  52. final def length: Int
    Definition Classes
    Iterator
    Annotations
    @inline()
  53. def map[B](f: (T) => B): Iterator[B]
    Definition Classes
    Iterator → IterableOnceOps
  54. def max[B >: T](implicit ord: Ordering[B]): T
    Definition Classes
    IterableOnceOps
  55. def maxBy[B](f: (T) => B)(implicit ord: Ordering[B]): T
    Definition Classes
    IterableOnceOps
  56. def maxByOption[B](f: (T) => B)(implicit ord: Ordering[B]): Option[T]
    Definition Classes
    IterableOnceOps
  57. def maxOption[B >: T](implicit ord: Ordering[B]): Option[T]
    Definition Classes
    IterableOnceOps
  58. def min[B >: T](implicit ord: Ordering[B]): T
    Definition Classes
    IterableOnceOps
  59. def minBy[B](f: (T) => B)(implicit ord: Ordering[B]): T
    Definition Classes
    IterableOnceOps
  60. def minByOption[B](f: (T) => B)(implicit ord: Ordering[B]): Option[T]
    Definition Classes
    IterableOnceOps
  61. def minOption[B >: T](implicit ord: Ordering[B]): Option[T]
    Definition Classes
    IterableOnceOps
  62. final def mkString: String
    Definition Classes
    IterableOnceOps
    Annotations
    @inline()
  63. final def mkString(sep: String): String
    Definition Classes
    IterableOnceOps
    Annotations
    @inline()
  64. final def mkString(start: String, sep: String, end: String): String
    Definition Classes
    IterableOnceOps
  65. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  66. def next(): T
    Definition Classes
    ContextAwareIterator → Iterator
  67. def nextOption(): Option[T]
    Definition Classes
    Iterator
  68. def nonEmpty: Boolean
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecatedOverriding()
  69. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  70. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  71. def padTo[B >: T](len: Int, elem: B): Iterator[B]
    Definition Classes
    Iterator
  72. def partition(p: (T) => Boolean): (Iterator[T], Iterator[T])
    Definition Classes
    Iterator
  73. def patch[B >: T](from: Int, patchElems: Iterator[B], replaced: Int): Iterator[B]
    Definition Classes
    Iterator
  74. def product[B >: T](implicit num: Numeric[B]): B
    Definition Classes
    IterableOnceOps
  75. def reduce[B >: T](op: (B, B) => B): B
    Definition Classes
    IterableOnceOps
  76. def reduceLeft[B >: T](op: (B, T) => B): B
    Definition Classes
    IterableOnceOps
  77. def reduceLeftOption[B >: T](op: (B, T) => B): Option[B]
    Definition Classes
    IterableOnceOps
  78. def reduceOption[B >: T](op: (B, B) => B): Option[B]
    Definition Classes
    IterableOnceOps
  79. def reduceRight[B >: T](op: (T, B) => B): B
    Definition Classes
    IterableOnceOps
  80. def reduceRightOption[B >: T](op: (T, B) => B): Option[B]
    Definition Classes
    IterableOnceOps
  81. def reversed: Iterable[T]
    Attributes
    protected
    Definition Classes
    IterableOnceOps
  82. def sameElements[B >: T](that: IterableOnce[B]): Boolean
    Definition Classes
    Iterator
  83. def scanLeft[B](z: B)(op: (B, T) => B): Iterator[B]
    Definition Classes
    Iterator → IterableOnceOps
  84. def size: Int
    Definition Classes
    IterableOnceOps
  85. def slice(from: Int, until: Int): Iterator[T]
    Definition Classes
    Iterator → IterableOnceOps
  86. def sliceIterator(from: Int, until: Int): Iterator[T]
    Attributes
    protected
    Definition Classes
    Iterator
  87. def sliding[B >: T](size: Int, step: Int): GroupedIterator[B]
    Definition Classes
    Iterator
  88. def span(p: (T) => Boolean): (Iterator[T], Iterator[T])
    Definition Classes
    Iterator → IterableOnceOps
  89. def splitAt(n: Int): (Iterator[T], Iterator[T])
    Definition Classes
    IterableOnceOps
  90. def stepper[S <: Stepper[_]](implicit shape: StepperShape[T, S]): S
    Definition Classes
    IterableOnce
  91. def sum[B >: T](implicit num: Numeric[B]): B
    Definition Classes
    IterableOnceOps
  92. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  93. def take(n: Int): Iterator[T]
    Definition Classes
    Iterator → IterableOnceOps
  94. def takeWhile(p: (T) => Boolean): Iterator[T]
    Definition Classes
    Iterator → IterableOnceOps
  95. def tapEach[U](f: (T) => U): Iterator[T]
    Definition Classes
    Iterator → IterableOnceOps
  96. def to[C1](factory: Factory[T, C1]): C1
    Definition Classes
    IterableOnceOps
  97. def toArray[B >: T](implicit arg0: ClassTag[B]): Array[B]
    Definition Classes
    IterableOnceOps
  98. final def toBuffer[B >: T]: Buffer[B]
    Definition Classes
    IterableOnceOps
    Annotations
    @inline()
  99. def toIndexedSeq: IndexedSeq[T]
    Definition Classes
    IterableOnceOps
  100. def toList: List[T]
    Definition Classes
    IterableOnceOps
  101. def toMap[K, V](implicit ev: <:<[T, (K, V)]): Map[K, V]
    Definition Classes
    IterableOnceOps
  102. def toSeq: Seq[T]
    Definition Classes
    IterableOnceOps
  103. def toSet[B >: T]: Set[B]
    Definition Classes
    IterableOnceOps
  104. def toString(): String
    Definition Classes
    Iterator → AnyRef → Any
  105. def toVector: Vector[T]
    Definition Classes
    IterableOnceOps
  106. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  107. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  108. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  109. def withFilter(p: (T) => Boolean): Iterator[T]
    Definition Classes
    Iterator
  110. def zip[B](that: IterableOnce[B]): Iterator[(T, B)]
    Definition Classes
    Iterator
  111. def zipAll[A1 >: T, B](that: IterableOnce[B], thisElem: A1, thatElem: B): Iterator[(A1, B)]
    Definition Classes
    Iterator
  112. def zipWithIndex: Iterator[(T, Int)]
    Definition Classes
    Iterator → IterableOnceOps

Deprecated Value Members

  1. final def /:[B](z: B)(op: (B, T) => B): B
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) Use foldLeft instead of /:

  2. final def :\[B](z: B)(op: (T, B) => B): B
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) Use foldRight instead of :\

  3. def aggregate[B](z: => B)(seqop: (B, T) => B, combop: (B, B) => B): B
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) For sequential collections, prefer foldLeft(z)(seqop). For parallel collections, use ParIterableLike#aggregate.

  4. final def copyToBuffer[B >: T](dest: Buffer[B]): Unit
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) Use dest ++= coll instead

  5. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

  6. final def hasDefiniteSize: Boolean
    Definition Classes
    Iterator → IterableOnceOps
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) hasDefiniteSize on Iterator is the same as isEmpty

  7. def scanRight[B](z: B)(op: (T, B) => B): Iterator[B]
    Definition Classes
    Iterator
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Call scanRight on an Iterable instead.

  8. def seq: ContextAwareIterator.this.type
    Definition Classes
    Iterator
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Iterator.seq always returns the iterator itself

  9. final def toIterator: Iterator[T]
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) Use .iterator instead of .toIterator

  10. final def toStream: Stream[T]
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) Use .to(LazyList) instead of .toStream

Inherited from Iterator[T]

Inherited from IterableOnceOps[T, Iterator, Iterator[T]]

Inherited from IterableOnce[T]

Inherited from AnyRef

Inherited from Any

Ungrouped