package batches
- Alphabetic
- Public
- All
Type Members
-
final
class
ArrayBatch[A] extends Batch[A]
Batch implementation that wraps an array, based on ArrayCursor.
-
final
class
ArrayCursor[A] extends BatchCursor[A]
BatchCursor type that works over an underlying
Array.BatchCursor type that works over an underlying
Array.NOTE: all transformations happen by copying from the source array into a modified copy, hence all transformations have strict behavior!
To build an instance, prefer
BatchCursor.fromArray. -
abstract
class
Batch[+A] extends Serializable
The
Batchis a BatchCursor factory, similar in spirit with Scala's Iterable.The
Batchis a BatchCursor factory, similar in spirit with Scala's Iterable.Its cursor() method can be called repeatedly to yield the same sequence.
This class is provided as an alternative to Scala's Iterable because:
- the list of supported operations is smaller
- implementations specialized for primitives are provided to avoid boxing
- it's a factory of BatchCursor, which provides hints
for
recommendedBatchSize, meaning how many batch can be processed in a batches
Used in the Iterant implementation.
-
abstract
class
BatchCursor[+A] extends Serializable
Similar to Java's and Scala's
Iterator, theBatchCursortype can can be used to iterate over the data in a collection, but it cannot be used to modify the underlying collection.Similar to Java's and Scala's
Iterator, theBatchCursortype can can be used to iterate over the data in a collection, but it cannot be used to modify the underlying collection.Inspired by the standard
Iterator, provides a way to efficiently apply operations such asmap,filter,collecton the underlying collection without such operations having necessarily lazy behavior. So in other words, when wrapping a standardArray, an application ofmapwill copy the data to a newArrayinstance with its elements modified, immediately and is thus having strict (eager) behavior. In other cases, when wrapping potentially infinite collections, likeIterableorStream, that's when lazy behavior happens.Sample:
def sum(cursor: BatchCursor[Int]): Long = { var sum = 0L while (cursor.hasNext()) { sum += cursor.next() } sum }
This class is provided as an alternative to Scala's Iterator because:
- the list of supported operations is smaller
- implementations specialized for primitives are provided to avoid boxing
- depending on the implementation, the behaviour of operators
can be eager (e.g.
map,filter), but only in case the source cursor doesn't need to be consumed (if the cursor is backed by an array, then a new array gets created, etc.) - the
recommendedBatchSizecan signal how many batch can be processed in batches
Used in the Iterant implementation.
-
final
class
BooleansBatch extends Batch[Boolean]
Batch implementation specialized for
Boolean.Batch implementation specialized for
Boolean.Under the hood it uses an ArrayBatch implementation, which is
@specialized. UsingBooleansBatchmight be desirable instead forisInstanceOfchecks. -
final
class
BooleansCursor extends BatchCursor[Boolean]
BatchCursor implementation specialized for
Boolean.BatchCursor implementation specialized for
Boolean.Under the hood it uses an ArrayCursor implementation, which is
@specialized. UsingBooleansCursormight be desirable instead forisInstanceOfchecks. -
final
class
BytesBatch extends Batch[Byte]
Batch implementation specialized for
Byte.Batch implementation specialized for
Byte.Under the hood it uses an ArrayBatch implementation, which is
@specialized. UsingBytesBatchmight be desirable instead forisInstanceOfchecks. -
final
class
BytesCursor extends BatchCursor[Byte]
BatchCursor implementation specialized for
Byte.BatchCursor implementation specialized for
Byte.Under the hood it uses an ArrayCursor implementation, which is
@specialized. UsingBytesCursormight be desirable instead forisInstanceOfchecks. -
final
class
CharsBatch extends Batch[Char]
Batch implementation specialized for
Char.Batch implementation specialized for
Char.Under the hood it uses an ArrayBatch implementation, which is
@specialized. UsingCharsBatchmight be desirable instead forisInstanceOfchecks. -
final
class
CharsCursor extends BatchCursor[Char]
BatchCursor implementation specialized for
Char.BatchCursor implementation specialized for
Char.Under the hood it uses an ArrayCursor implementation, which is
@specialized. UsingCharsCursormight be desirable instead forisInstanceOfchecks. -
final
class
DoublesBatch extends Batch[Double]
Batch implementation specialized for
Double.Batch implementation specialized for
Double.Under the hood it uses an ArrayBatch implementation, which is
@specialized. UsingDoublesBatchmight be desirable instead forisInstanceOfchecks. -
final
class
DoublesCursor extends BatchCursor[Double]
BatchCursor implementation specialized for
Double.BatchCursor implementation specialized for
Double.Under the hood it uses an ArrayCursor implementation, which is
@specialized. UsingDoublesCursormight be desirable instead forisInstanceOfchecks. -
abstract
class
GenericBatch[+A] extends Batch[A]
Reusable Batch base class that can be used for implementing generators that simply modify their underlying cursor reference.
-
abstract
class
GenericCursor[+A] extends BatchCursor[A]
Reusable BatchCursor base class that can be used for implementing cursors by just providing the primitive operations,
hasNext,nextandrecommendedBatchSize. -
final
class
IntegersBatch extends Batch[Int]
Batch implementation specialized for
Int.Batch implementation specialized for
Int.Under the hood it uses an ArrayBatch implementation, which is
@specialized. UsingIntegersBatchmight be desirable instead forisInstanceOfchecks. -
final
class
IntegersCursor extends BatchCursor[Int]
BatchCursor implementation specialized for
Int.BatchCursor implementation specialized for
Int.Under the hood it uses an ArrayCursor implementation, which is
@specialized. UsingIntegersCursormight be desirable instead forisInstanceOfchecks. -
final
class
IteratorCursor[+A] extends BatchCursor[A]
BatchCursor type that works over an underlying
Iterator.BatchCursor type that works over an underlying
Iterator.NOTE: all transformations are delegated to the underlying
Iteratorand may thus have lazy behavior. -
final
class
LongsBatch extends Batch[Long]
Batch implementation specialized for
Long.Batch implementation specialized for
Long.Under the hood it uses an ArrayBatch implementation, which is
@specialized. UsingLongsBatchmight be desirable instead forisInstanceOfchecks. -
final
class
LongsCursor extends BatchCursor[Long]
BatchCursor implementation specialized for
Long.BatchCursor implementation specialized for
Long.Under the hood it uses an ArrayCursor implementation, which is
@specialized. UsingLongsCursormight be desirable instead forisInstanceOfchecks. - final class SeqBatch[+A] extends Batch[A]
Value Members
-
object
Batch extends Serializable
Batch builders.
-
object
BatchCursor extends Serializable
BatchCursor builders.
-
object
EmptyBatch extends Batch[Nothing]
Reusable Batch implementation that's always empty.
-
object
EmptyCursor extends BatchCursor[Nothing]
BatchCursor implementation that's always empty.