MapReduceComposed

com.phasmid.majabigwaduce.core.MapReduceComposed
case class MapReduceComposed[T, K1, V1, K2, V2](f1: MapReduce[T, K1, V1], f2: Seq[(K1, V1)] => Future[Map[K2, V2]])(implicit ec: ExecutionContext) extends MapReduce[T, K2, V2]

A composition MapReduce class which represents a MapReduce "pipeline" with two stages.

Type parameters

K1

intermediate key type

K2

output key type

T

the input type of the MapReduce function: T may be V1 for a first stage, or (K1,V1) for a subsequent stage.

V1

intermediate value type

V2

output value type

Value parameters

f1

an instance of MapReduce which will become the first of two stages of the resulting MapReduce instance .

f2

an ASync[Seq[(K1, V1)], Map[K2, V2] instance (functionally equivalent to MapReduce) which will become the second of the two stages.

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait MapReduce[T, K2, V2]
trait AutoCloseable
trait Seq[T] => Future[Map[K2, V2]]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def apply(ts: Seq[T]): Future[Map[K2, V2]]

Applies the MapReduce pipeline to the provided input sequence, transforming it through the first stage and then the second stage to produce the final output.

Applies the MapReduce pipeline to the provided input sequence, transforming it through the first stage and then the second stage to produce the final output.

Value parameters

ts

the input sequence of type T to be processed through the MapReduce pipeline

Attributes

Returns

a Future containing a map of type Map[K2, V2], which represents the transformed output

def close(): Unit

Closes the first stage of the MapReduce pipeline, releasing any resources associated with it.

Closes the first stage of the MapReduce pipeline, releasing any resources associated with it.

Attributes

Returns

Unit, indicating that the operation completes without returning a value.

Inherited methods

def &[K2, V2](mr: MapReduce[(K2, V2), K2, V2]): MapReduce[T, K2, V2]

Alternative formulation for compose method (:&)

Alternative formulation for compose method (:&)

Type parameters

K2

the key type of the composed MapReduce object

V2

the value type of the composed MapReduce object

Value parameters

mr

the other MapReduce object

Attributes

Returns

a new MapReduceComposed object

Inherited from:
MapReduce
def :&[K2, V2](f: Seq[(K2, V2)] => Future[Map[K2, V2]]): MapReduce[T, K2, V2]

Compose this MapReduce object with mr, yielding a new MapReduce object.

Compose this MapReduce object with mr, yielding a new MapReduce object.

Type parameters

K2

the key type of the composed MapReduce object

V2

the value type of the composed MapReduce object

Value parameters

f

a function of type ASync[Seq[(K1, V1)], Map[K2, V2], i.e. Seq[(K1, V1)]=>Future[Map[K2, V2]

Attributes

Returns

a new MapReduceComposed object

Inherited from:
MapReduce
def :|[S](r: Map[K2, V2] => S)(implicit executionContext: ExecutionContext): Seq[T] => Future[S]

terminate this MapReduce object with r, a reducer which yields a simple value

terminate this MapReduce object with r, a reducer which yields a simple value

Type parameters

S

the return type, which is a super-class of V1 (for sum, or sigma)

Value parameters

executionContext

(implicit)

r

the Reduce object

Attributes

Returns

an Async function of Seq[T]=>Future[S] type S.

Inherited from:
MapReduce
def andThen[A](g: Future[Map[K2, V2]] => A): Seq[T] => A

Composes two instances of Function1 in a new Function1, with this function applied first.

Composes two instances of Function1 in a new Function1, with this function applied first.

Type parameters

A

the result type of function g

Value parameters

g

a function R => A

Attributes

Returns

a new function f such that f(x) == g(apply(x))

Inherited from:
Function1
def compose[A](g: A => Seq[T]): A => Future[Map[K2, V2]]

Composes two instances of Function1 in a new Function1, with this function applied last.

Composes two instances of Function1 in a new Function1, with this function applied last.

Type parameters

A

the type to which function g can be applied

Value parameters

g

a function A => T1

Attributes

Returns

a new function f such that f(x) == apply(g(x))

Inherited from:
Function1
def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
override def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Function1 -> Any
Inherited from:
Function1
def |[S](r: Map[K2, V2] => S)(implicit executionContext: ExecutionContext): Seq[T] => Future[S]

alternative name to terminate

alternative name to terminate

Type parameters

S

the return type, which is a super-class of V1 (for sum, or sigma)

Value parameters

executionContext

(implicit)

r

the Reduce object

Attributes

Returns

an Async function of Seq[T]=>Future[S] type S.

Inherited from:
MapReduce

Implicits

Implicits

implicit val ec: ExecutionContext

Attributes

Returns

a suitable execution context