a configured batch statement builder
a key generator for batches - statements with the same key generated by this function are grouped together into batches
maximum batch size
maximum number of batches which can remain in the buffer
data iterator
(Changed in version 2.8.0) collect
has changed. The previous behavior can be reproduced with toSeq
.
(groupingBatchBuilder: MonadOps[RichStatement]).filter(p)
(groupingBatchBuilder: MonadOps[RichStatement]).flatMap(f)
(groupingBatchBuilder: MonadOps[RichStatement]).map(f)
(groupingBatchBuilder: StringAdd).self
(groupingBatchBuilder: StringFormat).self
(groupingBatchBuilder: MonadOps[RichStatement]).withFilter(p)
(Since version 2.10.0) use fold instead
(Since version ) see corresponding Javadoc for more information.
(groupingBatchBuilder: ArrowAssoc[GroupingBatchBuilder[T]]).x
(Since version 2.10.0) Use leftOfArrow
instead
(groupingBatchBuilder: Ensuring[GroupingBatchBuilder[T]]).x
(Since version 2.10.0) Use resultOfEnsuring
instead
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
.data type