com.datastax.spark.connector.writer

GroupingBatchBuilder

class GroupingBatchBuilder[T] extends AbstractIterator[RichStatement] with Iterator[RichStatement]

A grouping batch builder is an iterator which take an iterator of single data items and tries to group those items into batches. For each data item, a batch key is computed with the provided function. The items for which the batch key is the same, are grouped together into a batch.

When the batch key for the consecutive data items is different, the items are added to separate batches, and those batches are added to the queue. The queue length is limited, therefore when it is full, the longest batch is removed and returned by the iterator. A batch is removed from the queue also in the case when it reaches the batch size limit.

The implementation is based on PriorityHashMap.

T

data type

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. GroupingBatchBuilder
  2. Iterator
  3. TraversableOnce
  4. GenTraversableOnce
  5. AbstractIterator
  6. UnmodifiableIterator
  7. Iterator
  8. AnyRef
  9. Any
Implicitly
  1. by MonadOps
  2. by any2stringadd
  3. by any2stringfmt
  4. by any2ArrowAssoc
  5. by any2Ensuring
  6. by alternateImplicit
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new GroupingBatchBuilder(batchStatementBuilder: BatchStatementBuilder[T], batchKeyGenerator: (BoundStatement) ⇒ Any, batchSize: BatchSize, maxBatches: Int, data: Iterator[T])

    batchStatementBuilder

    a configured batch statement builder

    batchKeyGenerator

    a key generator for batches - statements with the same key generated by this function are grouped together into batches

    batchSize

    maximum batch size

    maxBatches

    maximum number of batches which can remain in the buffer

    data

    data iterator

Type Members

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

    Definition Classes
    Iterator

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 +(other: String): String

    Implicit information
    This member is added by an implicit conversion from GroupingBatchBuilder[T] to StringAdd performed by method any2stringadd in scala.Predef.
    Definition Classes
    StringAdd
  5. def ++[B >: RichStatement](that: ⇒ GenTraversableOnce[B]): Iterator[B]

    Definition Classes
    Iterator
  6. def ->[B](y: B): (GroupingBatchBuilder[T], B)

    Implicit information
    This member is added by an implicit conversion from GroupingBatchBuilder[T] to ArrowAssoc[GroupingBatchBuilder[T]] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  7. def /:[B](z: B)(op: (B, RichStatement) ⇒ B): B

    Definition Classes
    TraversableOnce → GenTraversableOnce
  8. def :\[B](z: B)(op: (RichStatement, 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, RichStatement) ⇒ B, combop: (B, B) ⇒ B): B

    Definition Classes
    TraversableOnce → GenTraversableOnce
  15. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  16. def buffered: BufferedIterator[RichStatement]

    Definition Classes
    Iterator
  17. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. def collect[B](pf: PartialFunction[RichStatement, B]): Iterator[B]

    Definition Classes
    Iterator
    Annotations
    @migration
    Migration

    (Changed in version 2.8.0) collect has changed. The previous behavior can be reproduced with toSeq.

  19. def collectFirst[B](pf: PartialFunction[RichStatement, B]): Option[B]

    Definition Classes
    TraversableOnce
  20. final def computeNext(): RichStatement

    Definition Classes
    GroupingBatchBuilder → AbstractIterator
    Annotations
    @tailrec()
  21. def contains(elem: Any): Boolean

    Definition Classes
    Iterator
  22. def copyToArray[B >: RichStatement](xs: Array[B], start: Int, len: Int): Unit

    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  23. def copyToArray[B >: RichStatement](xs: Array[B]): Unit

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

    Definition Classes
    TraversableOnce → GenTraversableOnce
  25. def copyToBuffer[B >: RichStatement](dest: Buffer[B]): Unit

    Definition Classes
    TraversableOnce
  26. def corresponds[B](that: GenTraversableOnce[B])(p: (RichStatement, B) ⇒ Boolean): Boolean

    Definition Classes
    Iterator
  27. def count(p: (RichStatement) ⇒ Boolean): Int

    Definition Classes
    TraversableOnce → GenTraversableOnce
  28. def drop(n: Int): Iterator[RichStatement]

    Definition Classes
    Iterator
  29. def dropWhile(p: (RichStatement) ⇒ Boolean): Iterator[RichStatement]

    Definition Classes
    Iterator
  30. def duplicate: (Iterator[RichStatement], Iterator[RichStatement])

    Definition Classes
    Iterator
  31. final def endOfData(): RichStatement

    Attributes
    protected[com.google.common.collect]
    Definition Classes
    AbstractIterator
  32. def ensuring(cond: (GroupingBatchBuilder[T]) ⇒ Boolean, msg: ⇒ Any): GroupingBatchBuilder[T]

    Implicit information
    This member is added by an implicit conversion from GroupingBatchBuilder[T] to Ensuring[GroupingBatchBuilder[T]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  33. def ensuring(cond: (GroupingBatchBuilder[T]) ⇒ Boolean): GroupingBatchBuilder[T]

    Implicit information
    This member is added by an implicit conversion from GroupingBatchBuilder[T] to Ensuring[GroupingBatchBuilder[T]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  34. def ensuring(cond: Boolean, msg: ⇒ Any): GroupingBatchBuilder[T]

    Implicit information
    This member is added by an implicit conversion from GroupingBatchBuilder[T] to Ensuring[GroupingBatchBuilder[T]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  35. def ensuring(cond: Boolean): GroupingBatchBuilder[T]

    Implicit information
    This member is added by an implicit conversion from GroupingBatchBuilder[T] to Ensuring[GroupingBatchBuilder[T]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  36. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  38. def exists(p: (RichStatement) ⇒ Boolean): Boolean

    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  39. def filter(p: (RichStatement) ⇒ Boolean): Iterator[RichStatement]

    Definition Classes
    Iterator
  40. def filterNot(p: (RichStatement) ⇒ Boolean): Iterator[RichStatement]

    Definition Classes
    Iterator
  41. def finalize(): Unit

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

    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  43. def flatMap[B](f: (RichStatement) ⇒ GenTraversableOnce[B]): Iterator[B]

    Definition Classes
    Iterator
  44. def fold[A1 >: RichStatement](z: A1)(op: (A1, A1) ⇒ A1): A1

    Definition Classes
    TraversableOnce → GenTraversableOnce
  45. def foldLeft[B](z: B)(op: (B, RichStatement) ⇒ B): B

    Definition Classes
    TraversableOnce → GenTraversableOnce
  46. def foldRight[B](z: B)(op: (RichStatement, B) ⇒ B): B

    Definition Classes
    TraversableOnce → GenTraversableOnce
  47. def forall(p: (RichStatement) ⇒ Boolean): Boolean

    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  48. def foreach[U](f: (RichStatement) ⇒ U): Unit

    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  49. def formatted(fmtstr: String): String

    Implicit information
    This member is added by an implicit conversion from GroupingBatchBuilder[T] to StringFormat performed by method any2stringfmt in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  50. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  51. def grouped[B >: RichStatement](size: Int): GroupedIterator[B]

    Definition Classes
    Iterator
  52. def hasDefiniteSize: Boolean

    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  53. final def hasNext(): Boolean

    Definition Classes
    AbstractIterator → Iterator
  54. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  55. def indexOf[B >: RichStatement](elem: B): Int

    Definition Classes
    Iterator
  56. def indexWhere(p: (RichStatement) ⇒ Boolean): Int

    Definition Classes
    Iterator
  57. def isEmpty: Boolean

    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  58. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  59. def isTraversableAgain: Boolean

    Definition Classes
    Iterator → GenTraversableOnce
  60. def length: Int

    Definition Classes
    Iterator
  61. def map[B](f: (RichStatement) ⇒ B): Iterator[B]

    Definition Classes
    Iterator
  62. def max[B >: RichStatement](implicit cmp: Ordering[B]): RichStatement

    Definition Classes
    TraversableOnce → GenTraversableOnce
  63. def maxBy[B](f: (RichStatement) ⇒ B)(implicit cmp: Ordering[B]): RichStatement

    Definition Classes
    TraversableOnce → GenTraversableOnce
  64. def min[B >: RichStatement](implicit cmp: Ordering[B]): RichStatement

    Definition Classes
    TraversableOnce → GenTraversableOnce
  65. def minBy[B](f: (RichStatement) ⇒ B)(implicit cmp: Ordering[B]): RichStatement

    Definition Classes
    TraversableOnce → GenTraversableOnce
  66. def mkString: String

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

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

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

    Definition Classes
    AnyRef
  70. final def next(): RichStatement

    Definition Classes
    AbstractIterator → Iterator
  71. def nonEmpty: Boolean

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

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

    Definition Classes
    AnyRef
  74. def padTo[A1 >: RichStatement](len: Int, elem: A1): Iterator[A1]

    Definition Classes
    Iterator
  75. def partition(p: (RichStatement) ⇒ Boolean): (Iterator[RichStatement], Iterator[RichStatement])

    Definition Classes
    Iterator
  76. def patch[B >: RichStatement](from: Int, patchElems: Iterator[B], replaced: Int): Iterator[B]

    Definition Classes
    Iterator
  77. final def peek(): RichStatement

    Definition Classes
    AbstractIterator
  78. def product[B >: RichStatement](implicit num: Numeric[B]): B

    Definition Classes
    TraversableOnce → GenTraversableOnce
  79. def reduce[A1 >: RichStatement](op: (A1, A1) ⇒ A1): A1

    Definition Classes
    TraversableOnce → GenTraversableOnce
  80. def reduceLeft[B >: RichStatement](op: (B, RichStatement) ⇒ B): B

    Definition Classes
    TraversableOnce
  81. def reduceLeftOption[B >: RichStatement](op: (B, RichStatement) ⇒ B): Option[B]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  82. def reduceOption[A1 >: RichStatement](op: (A1, A1) ⇒ A1): Option[A1]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  83. def reduceRight[B >: RichStatement](op: (RichStatement, B) ⇒ B): B

    Definition Classes
    TraversableOnce → GenTraversableOnce
  84. def reduceRightOption[B >: RichStatement](op: (RichStatement, B) ⇒ B): Option[B]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  85. def reversed: List[RichStatement]

    Attributes
    protected[this]
    Definition Classes
    TraversableOnce
  86. def sameElements(that: Iterator[_]): Boolean

    Definition Classes
    Iterator
  87. def scanLeft[B](z: B)(op: (B, RichStatement) ⇒ B): Iterator[B]

    Definition Classes
    Iterator
  88. def scanRight[B](z: B)(op: (RichStatement, B) ⇒ B): Iterator[B]

    Definition Classes
    Iterator
  89. def seq: Iterator[RichStatement]

    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  90. def size: Int

    Definition Classes
    TraversableOnce → GenTraversableOnce
  91. def slice(from: Int, until: Int): Iterator[RichStatement]

    Definition Classes
    Iterator
  92. def sliding[B >: RichStatement](size: Int, step: Int): GroupedIterator[B]

    Definition Classes
    Iterator
  93. def span(p: (RichStatement) ⇒ Boolean): (Iterator[RichStatement], Iterator[RichStatement])

    Definition Classes
    Iterator
  94. def sum[B >: RichStatement](implicit num: Numeric[B]): B

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

    Definition Classes
    AnyRef
  96. def take(n: Int): Iterator[RichStatement]

    Definition Classes
    Iterator
  97. def takeWhile(p: (RichStatement) ⇒ Boolean): Iterator[RichStatement]

    Definition Classes
    Iterator
  98. def to[Col[_]](implicit cbf: CanBuildFrom[Nothing, RichStatement, Col[RichStatement]]): Col[RichStatement]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  99. def toArray[B >: RichStatement](implicit arg0: ClassTag[B]): Array[B]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  100. def toBuffer[B >: RichStatement]: Buffer[B]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  101. def toIndexedSeq: IndexedSeq[RichStatement]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  102. def toIterable: Iterable[RichStatement]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  103. def toIterator: Iterator[RichStatement]

    Definition Classes
    Iterator → GenTraversableOnce
  104. def toList: List[RichStatement]

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

    Definition Classes
    TraversableOnce → GenTraversableOnce
  106. def toSeq: Seq[RichStatement]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  107. def toSet[B >: RichStatement]: Set[B]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  108. def toStream: Stream[RichStatement]

    Definition Classes
    Iterator → GenTraversableOnce
  109. def toString(): String

    Definition Classes
    Iterator → AnyRef → Any
  110. def toTraversable: Traversable[RichStatement]

    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  111. def toVector: Vector[RichStatement]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  112. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  115. def withFilter(p: (RichStatement) ⇒ Boolean): Iterator[RichStatement]

    Definition Classes
    Iterator
  116. def zip[B](that: Iterator[B]): Iterator[(RichStatement, B)]

    Definition Classes
    Iterator
  117. def zipAll[B, A1 >: RichStatement, B1 >: B](that: Iterator[B], thisElem: A1, thatElem: B1): Iterator[(A1, B1)]

    Definition Classes
    Iterator
  118. def zipWithIndex: Iterator[(RichStatement, Int)]

    Definition Classes
    Iterator
  119. def [B](y: B): (GroupingBatchBuilder[T], B)

    Implicit information
    This member is added by an implicit conversion from GroupingBatchBuilder[T] to ArrowAssoc[GroupingBatchBuilder[T]] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Shadowed Implicit Value Members

  1. def filter(p: (RichStatement) ⇒ Boolean): TraversableOnce[RichStatement]

    Implicit information
    This member is added by an implicit conversion from GroupingBatchBuilder[T] to MonadOps[RichStatement] performed by method MonadOps in scala.collection.TraversableOnce.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (groupingBatchBuilder: MonadOps[RichStatement]).filter(p)
    Definition Classes
    MonadOps
  2. def flatMap[B](f: (RichStatement) ⇒ GenTraversableOnce[B]): TraversableOnce[B]

    Implicit information
    This member is added by an implicit conversion from GroupingBatchBuilder[T] to MonadOps[RichStatement] performed by method MonadOps in scala.collection.TraversableOnce.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (groupingBatchBuilder: MonadOps[RichStatement]).flatMap(f)
    Definition Classes
    MonadOps
  3. def map[B](f: (RichStatement) ⇒ B): TraversableOnce[B]

    Implicit information
    This member is added by an implicit conversion from GroupingBatchBuilder[T] to MonadOps[RichStatement] performed by method MonadOps in scala.collection.TraversableOnce.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (groupingBatchBuilder: MonadOps[RichStatement]).map(f)
    Definition Classes
    MonadOps
  4. val self: Any

    Implicit information
    This member is added by an implicit conversion from GroupingBatchBuilder[T] to StringAdd performed by method any2stringadd in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (groupingBatchBuilder: StringAdd).self
    Definition Classes
    StringAdd
  5. val self: Any

    Implicit information
    This member is added by an implicit conversion from GroupingBatchBuilder[T] to StringFormat performed by method any2stringfmt in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (groupingBatchBuilder: StringFormat).self
    Definition Classes
    StringFormat
  6. def withFilter(p: (RichStatement) ⇒ Boolean): Iterator[RichStatement]

    Implicit information
    This member is added by an implicit conversion from GroupingBatchBuilder[T] to MonadOps[RichStatement] performed by method MonadOps in scala.collection.TraversableOnce.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (groupingBatchBuilder: MonadOps[RichStatement]).withFilter(p)
    Definition Classes
    MonadOps

Deprecated Value Members

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

    Definition Classes
    GenTraversableOnce
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) use fold instead

  2. final def remove(): Unit

    Definition Classes
    UnmodifiableIterator → Iterator
    Annotations
    @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

  3. def x: GroupingBatchBuilder[T]

    Implicit information
    This member is added by an implicit conversion from GroupingBatchBuilder[T] to ArrowAssoc[GroupingBatchBuilder[T]] performed by method any2ArrowAssoc in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (groupingBatchBuilder: ArrowAssoc[GroupingBatchBuilder[T]]).x
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use leftOfArrow instead

  4. def x: GroupingBatchBuilder[T]

    Implicit information
    This member is added by an implicit conversion from GroupingBatchBuilder[T] to Ensuring[GroupingBatchBuilder[T]] performed by method any2Ensuring in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (groupingBatchBuilder: Ensuring[GroupingBatchBuilder[T]]).x
    Definition Classes
    Ensuring
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use resultOfEnsuring instead

Inherited from Iterator[RichStatement]

Inherited from TraversableOnce[RichStatement]

Inherited from AbstractIterator[RichStatement]

Inherited from UnmodifiableIterator[RichStatement]

Inherited from Iterator[RichStatement]

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion MonadOps from GroupingBatchBuilder[T] to MonadOps[RichStatement]

Inherited by implicit conversion any2stringadd from GroupingBatchBuilder[T] to StringAdd

Inherited by implicit conversion any2stringfmt from GroupingBatchBuilder[T] to StringFormat

Inherited by implicit conversion any2ArrowAssoc from GroupingBatchBuilder[T] to ArrowAssoc[GroupingBatchBuilder[T]]

Inherited by implicit conversion any2Ensuring from GroupingBatchBuilder[T] to Ensuring[GroupingBatchBuilder[T]]

Inherited by implicit conversion alternateImplicit from GroupingBatchBuilder[T] to ForceImplicitAmbiguity

Ungrouped