org.apache.spark.util.collection

AppendOnlyMap

class AppendOnlyMap[K, V] extends Iterable[(K, V)] with Serializable

:: DeveloperApi :: A simple open hash table optimized for the append-only use case, where keys are never removed, but the value for each key may be changed.

This implementation uses quadratic probing with a power-of-2 hash table size, which is guaranteed to explore all spaces for each key (see http://en.wikipedia.org/wiki/Quadratic_probing).

TODO: Cache the hash values of each key? java.util.HashMap does that.

Annotations
@DeveloperApi()
Linear Supertypes
Serializable, Serializable, Iterable[(K, V)], IterableLike[(K, V), Iterable[(K, V)]], Equals, GenIterable[(K, V)], GenIterableLike[(K, V), Iterable[(K, V)]], Traversable[(K, V)], GenTraversable[(K, V)], GenericTraversableTemplate[(K, V), Iterable], TraversableLike[(K, V), Iterable[(K, V)]], GenTraversableLike[(K, V), Iterable[(K, V)]], Parallelizable[(K, V), ParIterable[(K, V)]], TraversableOnce[(K, V)], GenTraversableOnce[(K, V)], FilterMonadic[(K, V), Iterable[(K, V)]], HasNewBuilder[(K, V), Iterable[(K, V)]], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. AppendOnlyMap
  2. Serializable
  3. Serializable
  4. Iterable
  5. IterableLike
  6. Equals
  7. GenIterable
  8. GenIterableLike
  9. Traversable
  10. GenTraversable
  11. GenericTraversableTemplate
  12. TraversableLike
  13. GenTraversableLike
  14. Parallelizable
  15. TraversableOnce
  16. GenTraversableOnce
  17. FilterMonadic
  18. HasNewBuilder
  19. AnyRef
  20. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new AppendOnlyMap(initialCapacity: Int = 64)

Type Members

  1. type Self = Iterable[(K, V)]

    Attributes
    protected[this]
    Definition Classes
    TraversableLike
  2. class WithFilter extends FilterMonadic[A, Repr]

    Definition Classes
    TraversableLike

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def ++[B >: (K, V), That](that: GenTraversableOnce[B])(implicit bf: CanBuildFrom[Iterable[(K, V)], B, That]): That

    Definition Classes
    TraversableLike → GenTraversableLike
  5. def ++:[B >: (K, V), That](that: Traversable[B])(implicit bf: CanBuildFrom[Iterable[(K, V)], B, That]): That

    Definition Classes
    TraversableLike
  6. def ++:[B >: (K, V), That](that: TraversableOnce[B])(implicit bf: CanBuildFrom[Iterable[(K, V)], B, That]): That

    Definition Classes
    TraversableLike
  7. def /:[B](z: B)(op: (B, (K, V)) ⇒ B): B

    Definition Classes
    TraversableOnce → GenTraversableOnce
  8. def :\[B](z: B)(op: ((K, V), B) ⇒ B): B

    Definition Classes
    TraversableOnce → GenTraversableOnce
  9. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  10. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  11. def addString(b: StringBuilder): StringBuilder

    Definition Classes
    TraversableOnce
  12. def addString(b: StringBuilder, sep: String): StringBuilder

    Definition Classes
    TraversableOnce
  13. def addString(b: StringBuilder, start: String, sep: String, end: String): StringBuilder

    Definition Classes
    TraversableOnce
  14. def aggregate[B](z: B)(seqop: (B, (K, V)) ⇒ B, combop: (B, B) ⇒ B): B

    Definition Classes
    TraversableOnce → GenTraversableOnce
  15. def apply(key: K): V

    Get the value for a given key

  16. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  17. def atGrowThreshold: Boolean

    Return whether the next insert will cause the map to grow

  18. def canEqual(that: Any): Boolean

    Definition Classes
    IterableLike → Equals
  19. def changeValue(key: K, updateFunc: (Boolean, V) ⇒ V): V

    Set the value for key to updateFunc(hadValue, oldValue), where oldValue will be the old value for key, if any, or null otherwise.

    Set the value for key to updateFunc(hadValue, oldValue), where oldValue will be the old value for key, if any, or null otherwise. Returns the newly updated value.

  20. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. def collect[B, That](pf: PartialFunction[(K, V), B])(implicit bf: CanBuildFrom[Iterable[(K, V)], B, That]): That

    Definition Classes
    TraversableLike → GenTraversableLike
  22. def collectFirst[B](pf: PartialFunction[(K, V), B]): Option[B]

    Definition Classes
    TraversableOnce
  23. def companion: GenericCompanion[Iterable]

    Definition Classes
    Iterable → GenIterable → Traversable → GenTraversable → GenericTraversableTemplate
  24. def copyToArray[B >: (K, V)](xs: Array[B], start: Int, len: Int): Unit

    Definition Classes
    IterableLike → TraversableLike → TraversableOnce → GenTraversableOnce
  25. def copyToArray[B >: (K, V)](xs: Array[B]): Unit

    Definition Classes
    TraversableOnce → GenTraversableOnce
  26. def copyToArray[B >: (K, V)](xs: Array[B], start: Int): Unit

    Definition Classes
    TraversableOnce → GenTraversableOnce
  27. def copyToBuffer[B >: (K, V)](dest: Buffer[B]): Unit

    Definition Classes
    TraversableOnce
  28. def count(p: ((K, V)) ⇒ Boolean): Int

    Definition Classes
    TraversableOnce → GenTraversableOnce
  29. def destructiveSortedIterator(keyComparator: Comparator[K]): Iterator[(K, V)]

    Return an iterator of the map in sorted order.

    Return an iterator of the map in sorted order. This provides a way to sort the map without using additional memory, at the expense of destroying the validity of the map.

  30. def drop(n: Int): Iterable[(K, V)]

    Definition Classes
    IterableLike → TraversableLike → GenTraversableLike
  31. def dropRight(n: Int): Iterable[(K, V)]

    Definition Classes
    IterableLike
  32. def dropWhile(p: ((K, V)) ⇒ Boolean): Iterable[(K, V)]

    Definition Classes
    TraversableLike → GenTraversableLike
  33. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  34. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  35. def exists(p: ((K, V)) ⇒ Boolean): Boolean

    Definition Classes
    IterableLike → TraversableLike → TraversableOnce → GenTraversableOnce
  36. def filter(p: ((K, V)) ⇒ Boolean): Iterable[(K, V)]

    Definition Classes
    TraversableLike → GenTraversableLike
  37. def filterNot(p: ((K, V)) ⇒ Boolean): Iterable[(K, V)]

    Definition Classes
    TraversableLike → GenTraversableLike
  38. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  39. def find(p: ((K, V)) ⇒ Boolean): Option[(K, V)]

    Definition Classes
    IterableLike → TraversableLike → TraversableOnce → GenTraversableOnce
  40. def flatMap[B, That](f: ((K, V)) ⇒ GenTraversableOnce[B])(implicit bf: CanBuildFrom[Iterable[(K, V)], B, That]): That

    Definition Classes
    TraversableLike → GenTraversableLike → FilterMonadic
  41. def flatten[B](implicit asTraversable: ((K, V)) ⇒ GenTraversableOnce[B]): Iterable[B]

    Definition Classes
    GenericTraversableTemplate
  42. def fold[A1 >: (K, V)](z: A1)(op: (A1, A1) ⇒ A1): A1

    Definition Classes
    TraversableOnce → GenTraversableOnce
  43. def foldLeft[B](z: B)(op: (B, (K, V)) ⇒ B): B

    Definition Classes
    TraversableOnce → GenTraversableOnce
  44. def foldRight[B](z: B)(op: ((K, V), B) ⇒ B): B

    Definition Classes
    IterableLike → TraversableOnce → GenTraversableOnce
  45. def forall(p: ((K, V)) ⇒ Boolean): Boolean

    Definition Classes
    IterableLike → TraversableLike → TraversableOnce → GenTraversableOnce
  46. def foreach[U](f: ((K, V)) ⇒ U): Unit

    Definition Classes
    IterableLike → TraversableLike → GenTraversableLike → TraversableOnce → GenTraversableOnce → FilterMonadic
  47. def genericBuilder[B]: Builder[B, Iterable[B]]

    Definition Classes
    GenericTraversableTemplate
  48. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  49. def groupBy[K](f: ((K, V)) ⇒ K): Map[K, Iterable[(K, V)]]

    Definition Classes
    TraversableLike → GenTraversableLike
  50. def grouped(size: Int): Iterator[Iterable[(K, V)]]

    Definition Classes
    IterableLike
  51. def growTable(): Unit

    Double the table's size and re-hash everything

    Double the table's size and re-hash everything

    Attributes
    protected
  52. def hasDefiniteSize: Boolean

    Definition Classes
    TraversableLike → TraversableOnce → GenTraversableOnce
  53. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  54. def head: (K, V)

    Definition Classes
    IterableLike → TraversableLike → GenTraversableLike
  55. def headOption: Option[(K, V)]

    Definition Classes
    TraversableLike → GenTraversableLike
  56. def init: Iterable[(K, V)]

    Definition Classes
    TraversableLike → GenTraversableLike
  57. def inits: Iterator[Iterable[(K, V)]]

    Definition Classes
    TraversableLike
  58. def isEmpty: Boolean

    Definition Classes
    IterableLike → TraversableLike → TraversableOnce → GenTraversableOnce
  59. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  60. final def isTraversableAgain: Boolean

    Definition Classes
    TraversableLike → GenTraversableLike → GenTraversableOnce
  61. def iterator: Iterator[(K, V)]

    Iterator method from Iterable

    Iterator method from Iterable

    Definition Classes
    AppendOnlyMap → IterableLike → GenIterableLike
  62. def last: (K, V)

    Definition Classes
    TraversableLike → GenTraversableLike
  63. def lastOption: Option[(K, V)]

    Definition Classes
    TraversableLike → GenTraversableLike
  64. def map[B, That](f: ((K, V)) ⇒ B)(implicit bf: CanBuildFrom[Iterable[(K, V)], B, That]): That

    Definition Classes
    TraversableLike → GenTraversableLike → FilterMonadic
  65. def max[B >: (K, V)](implicit cmp: Ordering[B]): (K, V)

    Definition Classes
    TraversableOnce → GenTraversableOnce
  66. def maxBy[B](f: ((K, V)) ⇒ B)(implicit cmp: Ordering[B]): (K, V)

    Definition Classes
    TraversableOnce → GenTraversableOnce
  67. def min[B >: (K, V)](implicit cmp: Ordering[B]): (K, V)

    Definition Classes
    TraversableOnce → GenTraversableOnce
  68. def minBy[B](f: ((K, V)) ⇒ B)(implicit cmp: Ordering[B]): (K, V)

    Definition Classes
    TraversableOnce → GenTraversableOnce
  69. def mkString: String

    Definition Classes
    TraversableOnce → GenTraversableOnce
  70. def mkString(sep: String): String

    Definition Classes
    TraversableOnce → GenTraversableOnce
  71. def mkString(start: String, sep: String, end: String): String

    Definition Classes
    TraversableOnce → GenTraversableOnce
  72. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  73. def newBuilder: Builder[(K, V), Iterable[(K, V)]]

    Attributes
    protected[this]
    Definition Classes
    GenericTraversableTemplate → HasNewBuilder
  74. def nonEmpty: Boolean

    Definition Classes
    TraversableOnce → GenTraversableOnce
  75. final def notify(): Unit

    Definition Classes
    AnyRef
  76. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  77. def par: ParIterable[(K, V)]

    Definition Classes
    Parallelizable
  78. def parCombiner: Combiner[(K, V), ParIterable[(K, V)]]

    Attributes
    protected[this]
    Definition Classes
    TraversableLike → Parallelizable
  79. def partition(p: ((K, V)) ⇒ Boolean): (Iterable[(K, V)], Iterable[(K, V)])

    Definition Classes
    TraversableLike → GenTraversableLike
  80. def product[B >: (K, V)](implicit num: Numeric[B]): B

    Definition Classes
    TraversableOnce → GenTraversableOnce
  81. def reduce[A1 >: (K, V)](op: (A1, A1) ⇒ A1): A1

    Definition Classes
    TraversableOnce → GenTraversableOnce
  82. def reduceLeft[B >: (K, V)](op: (B, (K, V)) ⇒ B): B

    Definition Classes
    TraversableOnce
  83. def reduceLeftOption[B >: (K, V)](op: (B, (K, V)) ⇒ B): Option[B]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  84. def reduceOption[A1 >: (K, V)](op: (A1, A1) ⇒ A1): Option[A1]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  85. def reduceRight[B >: (K, V)](op: ((K, V), B) ⇒ B): B

    Definition Classes
    IterableLike → TraversableOnce → GenTraversableOnce
  86. def reduceRightOption[B >: (K, V)](op: ((K, V), B) ⇒ B): Option[B]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  87. def repr: Iterable[(K, V)]

    Definition Classes
    TraversableLike → GenTraversableLike
  88. def reversed: List[(K, V)]

    Attributes
    protected[this]
    Definition Classes
    TraversableOnce
  89. def sameElements[B >: (K, V)](that: GenIterable[B]): Boolean

    Definition Classes
    IterableLike → GenIterableLike
  90. def scan[B >: (K, V), That](z: B)(op: (B, B) ⇒ B)(implicit cbf: CanBuildFrom[Iterable[(K, V)], B, That]): That

    Definition Classes
    TraversableLike → GenTraversableLike
  91. def scanLeft[B, That](z: B)(op: (B, (K, V)) ⇒ B)(implicit bf: CanBuildFrom[Iterable[(K, V)], B, That]): That

    Definition Classes
    TraversableLike → GenTraversableLike
  92. def scanRight[B, That](z: B)(op: ((K, V), B) ⇒ B)(implicit bf: CanBuildFrom[Iterable[(K, V)], B, That]): That

    Definition Classes
    TraversableLike → GenTraversableLike
    Annotations
    @migration
    Migration

    (Changed in version 2.9.0) The behavior of scanRight has changed. The previous behavior can be reproduced with scanRight.reverse.

  93. def seq: Iterable[(K, V)]

    Definition Classes
    Iterable → GenIterable → Traversable → GenTraversable → Parallelizable → TraversableOnce → GenTraversableOnce
  94. def size: Int

    Definition Classes
    AppendOnlyMap → GenTraversableLike → TraversableOnce → GenTraversableOnce
  95. def slice(from: Int, until: Int): Iterable[(K, V)]

    Definition Classes
    IterableLike → TraversableLike → GenTraversableLike
  96. def sliding(size: Int, step: Int): Iterator[Iterable[(K, V)]]

    Definition Classes
    IterableLike
  97. def sliding(size: Int): Iterator[Iterable[(K, V)]]

    Definition Classes
    IterableLike
  98. def span(p: ((K, V)) ⇒ Boolean): (Iterable[(K, V)], Iterable[(K, V)])

    Definition Classes
    TraversableLike → GenTraversableLike
  99. def splitAt(n: Int): (Iterable[(K, V)], Iterable[(K, V)])

    Definition Classes
    TraversableLike → GenTraversableLike
  100. def stringPrefix: String

    Definition Classes
    TraversableLike → GenTraversableLike
  101. def sum[B >: (K, V)](implicit num: Numeric[B]): B

    Definition Classes
    TraversableOnce → GenTraversableOnce
  102. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  103. def tail: Iterable[(K, V)]

    Definition Classes
    TraversableLike → GenTraversableLike
  104. def tails: Iterator[Iterable[(K, V)]]

    Definition Classes
    TraversableLike
  105. def take(n: Int): Iterable[(K, V)]

    Definition Classes
    IterableLike → TraversableLike → GenTraversableLike
  106. def takeRight(n: Int): Iterable[(K, V)]

    Definition Classes
    IterableLike
  107. def takeWhile(p: ((K, V)) ⇒ Boolean): Iterable[(K, V)]

    Definition Classes
    IterableLike → TraversableLike → GenTraversableLike
  108. def thisCollection: Iterable[(K, V)]

    Attributes
    protected[this]
    Definition Classes
    IterableLike → TraversableLike
  109. def to[Col[_]](implicit cbf: CanBuildFrom[Nothing, (K, V), Col[(K, V)]]): Col[(K, V)]

    Definition Classes
    TraversableLike → TraversableOnce → GenTraversableOnce
  110. def toArray[B >: (K, V)](implicit arg0: ClassTag[B]): Array[B]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  111. def toBuffer[B >: (K, V)]: Buffer[B]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  112. def toCollection(repr: Iterable[(K, V)]): Iterable[(K, V)]

    Attributes
    protected[this]
    Definition Classes
    IterableLike → TraversableLike
  113. def toIndexedSeq: IndexedSeq[(K, V)]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  114. def toIterable: Iterable[(K, V)]

    Definition Classes
    IterableLike → TraversableOnce → GenTraversableOnce
  115. def toIterator: Iterator[(K, V)]

    Definition Classes
    IterableLike → TraversableLike → GenTraversableOnce
  116. def toList: List[(K, V)]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  117. def toMap[T, U](implicit ev: <:<[(K, V), (T, U)]): Map[T, U]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  118. def toSeq: Seq[(K, V)]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  119. def toSet[B >: (K, V)]: Set[B]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  120. def toStream: Stream[(K, V)]

    Definition Classes
    IterableLike → TraversableLike → GenTraversableOnce
  121. def toString(): String

    Definition Classes
    TraversableLike → Any
  122. def toTraversable: Traversable[(K, V)]

    Definition Classes
    TraversableLike → TraversableOnce → GenTraversableOnce
  123. def toVector: scala.Vector[(K, V)]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  124. def transpose[B](implicit asTraversable: ((K, V)) ⇒ GenTraversableOnce[B]): Iterable[Iterable[B]]

    Definition Classes
    GenericTraversableTemplate
    Annotations
    @migration
    Migration

    (Changed in version 2.9.0) transpose throws an IllegalArgumentException if collections are not uniformly sized.

  125. def unzip[A1, A2](implicit asPair: ((K, V)) ⇒ (A1, A2)): (Iterable[A1], Iterable[A2])

    Definition Classes
    GenericTraversableTemplate
  126. def unzip3[A1, A2, A3](implicit asTriple: ((K, V)) ⇒ (A1, A2, A3)): (Iterable[A1], Iterable[A2], Iterable[A3])

    Definition Classes
    GenericTraversableTemplate
  127. def update(key: K, value: V): Unit

    Set the value for a key

  128. def view(from: Int, until: Int): IterableView[(K, V), Iterable[(K, V)]]

    Definition Classes
    IterableLike → TraversableLike
  129. def view: IterableView[(K, V), Iterable[(K, V)]]

    Definition Classes
    IterableLike → TraversableLike
  130. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  131. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  132. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  133. def withFilter(p: ((K, V)) ⇒ Boolean): FilterMonadic[(K, V), Iterable[(K, V)]]

    Definition Classes
    TraversableLike → FilterMonadic
  134. def zip[A1 >: (K, V), B, That](that: GenIterable[B])(implicit bf: CanBuildFrom[Iterable[(K, V)], (A1, B), That]): That

    Definition Classes
    IterableLike → GenIterableLike
  135. def zipAll[B, A1 >: (K, V), That](that: GenIterable[B], thisElem: A1, thatElem: B)(implicit bf: CanBuildFrom[Iterable[(K, V)], (A1, B), That]): That

    Definition Classes
    IterableLike → GenIterableLike
  136. def zipWithIndex[A1 >: (K, V), That](implicit bf: CanBuildFrom[Iterable[(K, V)], (A1, Int), That]): That

    Definition Classes
    IterableLike → GenIterableLike

Deprecated Value Members

  1. def /:\[A1 >: (K, V)](z: A1)(op: (A1, A1) ⇒ A1): A1

    Definition Classes
    GenTraversableOnce
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) use fold instead

Inherited from Serializable

Inherited from Serializable

Inherited from Iterable[(K, V)]

Inherited from IterableLike[(K, V), Iterable[(K, V)]]

Inherited from Equals

Inherited from GenIterable[(K, V)]

Inherited from GenIterableLike[(K, V), Iterable[(K, V)]]

Inherited from Traversable[(K, V)]

Inherited from GenTraversable[(K, V)]

Inherited from GenericTraversableTemplate[(K, V), Iterable]

Inherited from TraversableLike[(K, V), Iterable[(K, V)]]

Inherited from GenTraversableLike[(K, V), Iterable[(K, V)]]

Inherited from Parallelizable[(K, V), ParIterable[(K, V)]]

Inherited from TraversableOnce[(K, V)]

Inherited from GenTraversableOnce[(K, V)]

Inherited from FilterMonadic[(K, V), Iterable[(K, V)]]

Inherited from HasNewBuilder[(K, V), Iterable[(K, V)]]

Inherited from AnyRef

Inherited from Any

Ungrouped