LazySeq

fm.lazyseq.LazySeq
See theLazySeq companion object
trait LazySeq[+A] extends WithFilterCompat[A, LazySeq] with TraversableOnce[A]

A Non-Strict Traversable meant to be used for reading resources (Files, InputStreams, etc...) that might not fit into memory and may or may not be re-readable.

Attributes

Companion:
object
Graph
Supertypes
trait TraversableOnce[A]
class WithFilterCompat[A, LazySeq]
class WithFilter[A, LazySeq]
trait Serializable
class Object
trait Matchable
class Any
Known subtypes

Members list

Concise view

Value members

Abstract methods

def foreach[U](f: A => U): Unit

This is the method that sub-classes must implement

This is the method that sub-classes must implement

Attributes

Concrete methods

final def ++[B >: A](rest: LazySeq[B]): LazySeq[B]
final def after[U](f: A => U): LazySeq[A]

Run this function on each item after the foreach function

Run this function on each item after the foreach function

This is basically a foreach but without forcing evaluation of this LazySeq.

Attributes

final def afterWithResource[R, U](resource: Resource[R])(f: (A, R) => U): LazySeq[A]

Same as after() but takes a Resource (i.e. can use it for something like logging)

Same as after() but takes a Resource (i.e. can use it for something like logging)

Attributes

final def assertSorted[B >: A](implicit ord: Ordering[B]): LazySeq[B]

Assert that this reader is in sorted order

Assert that this reader is in sorted order

Attributes

final def assertSortedAndUnique[B >: A](implicit ord: Ordering[B]): LazySeq[B]

Assert that this reader is in sorted order AND unique

Assert that this reader is in sorted order AND unique

Attributes

final def assertSortedAndUniqueBy[K](key: A => K)(implicit ord: Ordering[K]): LazySeq[A]
final def assertSortedBy[K](key: A => K)(implicit ord: Ordering[K]): LazySeq[A]
final def before[U](f: A => U): LazySeq[A]

Run this function on each item before the foreach function

Run this function on each item before the foreach function

This is basically a foreach but without forcing evaluation of this LazySeq.

Attributes

final def beforeWithResource[R, U](resource: Resource[R])(f: (A, R) => U): LazySeq[A]

Same as before() but takes a Resource (i.e. can use it for something like logging)

Same as before() but takes a Resource (i.e. can use it for something like logging)

Attributes

final def bucketize[B >: A](num: Int)(implicit serializer: Serializer[B]): Vector[LazySeq[B]]

Split the LazySeq into num buckets of equal size using a round-robin algorithm

Split the LazySeq into num buckets of equal size using a round-robin algorithm

Attributes

final def buffered(size: Int): BufferedLazySeq[A]

Creates an asynchronous buffer that spins up a producer thread which feeds data into a BlockingQueue that is read using the resulting LazySeq. The created BlockingQueue will depend on the size passed in. If the size is <= 0 then a SynchronousQueue otherwise an ArrayBlockingQueue is used.

Creates an asynchronous buffer that spins up a producer thread which feeds data into a BlockingQueue that is read using the resulting LazySeq. The created BlockingQueue will depend on the size passed in. If the size is <= 0 then a SynchronousQueue otherwise an ArrayBlockingQueue is used.

Attributes

final def buffered[B >: A](queue: BlockingQueue[B]): BufferedLazySeq[B]

Creates an asynchronous buffer that spins up a producer thread which feeds data into a BlockingQueue that is read using the resulting LazySeq. This overload lets you pass in your own BlockingQueue implementation instead of having one created for you.

Creates an asynchronous buffer that spins up a producer thread which feeds data into a BlockingQueue that is read using the resulting LazySeq. This overload lets you pass in your own BlockingQueue implementation instead of having one created for you.

Attributes

final def collapseBy[B >: A, K](key: B => K)(op: (B, B) => B)(implicit ord: Ordering[K]): LazySeq[B]
final def collect[B](pf: PartialFunction[A, B]): LazySeq[B]
final def copyToArray[B >: A](xs: Array[B], start: Int, len: Int): Unit
final def drop(n: Int): LazySeq[A]
final def dropRight(n: Int): LazySeq[A]
final def dropWhile(p: A => Boolean): LazySeq[A]
final def exists(p: A => Boolean): Boolean
final def filter(p: A => Boolean): LazySeq[A]
final def filterNot(p: A => Boolean): LazySeq[A]
final def find(p: A => Boolean): Option[A]
final def flatMap[B](f: A => IterableOnce[B]): LazySeq[B]
final def flatMap[B](f: A => TraversableOnce[B])(implicit dummyImplicit: DummyImplicit): LazySeq[B]
final def flatten[B](implicit asTraversable: A => IterableOnce[B]): LazySeq[B]
final def forall(p: A => Boolean): Boolean
final def groupBy[B >: A, K](serializer: Serializer[B])(f: A => K): Map[K, LazySeq[B]]

Mostly standard group by implementation that uses tmp files to store the values of the HashMap

Mostly standard group by implementation that uses tmp files to store the values of the HashMap

Attributes

final def groupBy[B >: A, K](f: A => K)(implicit serializer: Serializer[B]): Map[K, LazySeq[B]]
final def grouped[B >: A](size: Int): LazySeq[IndexedSeq[B]]
final def grouped[B >: A](size: Int, additionalIncrement: B => Int): LazySeq[IndexedSeq[B]]
final def groupedBy[K](by: A => K): LazySeq[(K, IndexedSeq[A])]

A cross between grouped and groupBy that allows you to specify a key to be used (like in groupBy) instead of a fixed count (like in grouped). All elements next to each other with the same key get returned in each group.

A cross between grouped and groupBy that allows you to specify a key to be used (like in groupBy) instead of a fixed count (like in grouped). All elements next to each other with the same key get returned in each group.

e.g. LazySeq.wrap(Seq(1,1,1,2,2,1)).groupedBy{ a => a }.toIndexedSeq => Vector((1,Vector(1, 1, 1)), (2,Vector(2, 2)), (1,Vector(1)))

Attributes

def head: A
def headOption: Option[A]
def isEmpty: Boolean
override def knownSize: Int

Attributes

Returns:

The number of elements in this collection, if it can be cheaply computed, -1 otherwise. Cheaply usually means: Not requiring a collection traversal.

Definition Classes
TraversableOnce
final def map[B](f: A => B): LazySeq[B]
final def mergeCorresponding[B >: A](that: LazySeq[B])(implicit ord: Ordering[B]): LazySeq[EitherOrBoth[B, B]]
final def mergeCorrespondingByKey[R, K](that: LazySeq[R], thisKey: A => K, thatKey: R => K)(implicit ord: Ordering[K]): LazySeq[EitherOrBoth[A, R]]

Merge corresponding records from this sorted read with that sorted reader given a method to get a common key that can be compared.

Merge corresponding records from this sorted read with that sorted reader given a method to get a common key that can be compared.

Attributes

final def onFirst[U](f: A => U): LazySeq[A]

Execute the method on the first element of the LazySeq whenever it is evaluated.

Execute the method on the first element of the LazySeq whenever it is evaluated.

Note: The first element is still call via foreach

Attributes

final def onLast[U](f: A => U): LazySeq[A]

Same as onFirst except for the last element whenever it is evaluated

Same as onFirst except for the last element whenever it is evaluated

Attributes

final def parFlatMap[B](f: A => IterableOnce[B]): LazySeq[B]

Performs a parallel flat map maintaining ordered output

Performs a parallel flat map maintaining ordered output

Attributes

final def parFlatMap[B](threads: Int, inputBuffer: Int, resultBuffer: Int)(f: A => IterableOnce[B]): LazySeq[B]

Performs a parallel flat map maintaining ordered output

Performs a parallel flat map maintaining ordered output

Attributes

final def parForeach[U](f: A => U): Unit

A Parallel foreach

A Parallel foreach

Attributes

final def parForeach[U](threads: Int, inputBuffer: Int)(f: A => U): Unit

A Parallel foreach

A Parallel foreach

Attributes

final def parMap[B](f: A => B): LazySeq[B]

Performs a parallel map maintaining ordered output

Performs a parallel map maintaining ordered output

Attributes

final def parMap[B](threads: Int, inputBuffer: Int, resultBuffer: Int)(f: A => B): LazySeq[B]

Performs a parallel map maintaining ordered output

Performs a parallel map maintaining ordered output

Attributes

final def partition[B >: A](p: A => Boolean)(implicit serializer: Serializer[B]): (LazySeq[B], LazySeq[B])

Standard partition implementation using LazySeqs

Standard partition implementation using LazySeqs

Attributes

final def shuffle[B >: A](random: Random)(implicit serializer: Serializer[B]): LazySeq[B]
final def shuffle[B >: A](seed: Long)(implicit serializer: Serializer[B]): LazySeq[B]
final def shuffle[B >: A](implicit serializer: Serializer[B]): LazySeq[B]
final def slice(from: Int, until: Int): LazySeq[A]
final def sortAndCollapseBy[B >: A, K](serializer: Serializer[B])(key: B => K)(op: (B, B) => B)(implicit ord: Ordering[K]): LazySeq[B]

Collapse elements with the same key by applying a binary operator.

Collapse elements with the same key by applying a binary operator.

Should be similar to doing something like: reader.groupBy(key).values.flatMap{ _.reduce(op) }

Attributes

final def sortAndCollapseBy[B >: A, K](key: B => K)(op: (B, B) => B)(implicit serializer: Serializer[B], ord: Ordering[K]): LazySeq[B]
final def sortAndCollapseBy[B >: A, K](serializer: Serializer[B], bufferSizeLimitMB: Int, bufferRecordLimit: Int)(key: B => K)(op: (B, B) => B)(implicit ord: Ordering[K]): LazySeq[B]
final def sortAndCollapseBy[B >: A, K](bufferSizeLimitMB: Int, bufferRecordLimit: Int)(key: B => K)(op: (B, B) => B)(implicit serializer: Serializer[B], ord: Ordering[K]): LazySeq[B]
final def sortBy[B >: A, K](serializer: Serializer[B])(f: B => K)(implicit ord: Ordering[K]): LazySeq[B]
final def sortBy[B >: A, K](f: B => K)(implicit serializer: Serializer[B], ord: Ordering[K]): LazySeq[B]
final def sortBy[B >: A, K](serializer: Serializer[B], bufferSizeLimitMB: Int, bufferRecordLimit: Int)(f: B => K)(implicit ord: Ordering[K]): LazySeq[B]
final def sortBy[B >: A, K](bufferSizeLimitMB: Int, bufferRecordLimit: Int)(f: B => K)(implicit serializer: Serializer[B], ord: Ordering[K]): LazySeq[B]
final def sorted[B >: A](implicit serializer: Serializer[B], ord: Ordering[B]): LazySeq[B]
final def sorted[B >: A](bufferSizeLimitMB: Int, bufferRecordLimit: Int)(implicit serializer: Serializer[B], ord: Ordering[B]): LazySeq[B]
final def take(n: Int): LazySeq[A]
final def takeWhile(p: A => Boolean): LazySeq[A]
def toIterator: LazySeqIterator[A]
def toIterator(batchSize: Int, bufferSize: Int): LazySeqIterator[A]
final def unique: LazySeq[A]
final def uniqueSortBy[B >: A, K](serializer: Serializer[B])(f: B => K)(implicit ord: Ordering[K]): LazySeq[B]
final def uniqueSortBy[B >: A, K](f: B => K)(implicit serializer: Serializer[B], ord: Ordering[K]): LazySeq[B]
final def uniqueSorted[B >: A](implicit serializer: Serializer[B], ord: Ordering[B]): LazySeq[B]
final def uniqueUsing[K](f: A => K): LazySeq[A]
final def withFilter(p: A => Boolean): LazySeq[A]
final def zipWithIndex: LazySeq[(A, Int)]

Inherited methods

final def asTraversableOnce: TraversableOnce[A]

Attributes

Inherited from:
TraversableOnce
def foldLeft[B](z: B)(op: (B, A) => B): B

Attributes

Inherited from:
TraversableOnce
final def hasKnownSize: Boolean

Attributes

Inherited from:
TraversableOnce
final def hasKnownSizeAndIsEmpty: Boolean

Attributes

Inherited from:
TraversableOnce
final def hasKnownSizeAndIsNonEmpty: Boolean

Attributes

Inherited from:
TraversableOnce
def isTraversableAgain: Boolean

Attributes

Inherited from:
TraversableOnce
def max[B >: A](implicit cmp: Ordering[B]): A

Attributes

Inherited from:
TraversableOnce
def min[B >: A](implicit ord: Ordering[B]): A

Attributes

Inherited from:
TraversableOnce
def reduceLeft[B >: A](op: (B, A) => B): B

Attributes

Inherited from:
TraversableOnce
def reduceLeftOption[B >: A](op: (B, A) => B): Option[B]

Attributes

Inherited from:
TraversableOnce
def sum[B >: A](implicit num: Numeric[B]): B

Attributes

Inherited from:
TraversableOnce
def toArray[B >: A : ClassTag]: Array[B]

Attributes

Inherited from:
TraversableOnce
def toIndexedSeq: IndexedSeq[A]

Attributes

Inherited from:
TraversableOnce
def toList: List[A]

Attributes

Inherited from:
TraversableOnce
def toSeq: Seq[A]

Attributes

Inherited from:
TraversableOnce
def toVector: Vector[A]

Attributes

Inherited from:
TraversableOnce