MapReduce_Base

com.phasmid.majabigwaduce.core.MapReduce_Base
abstract class MapReduce_Base[T, K1M, V1M, K, V](actors: Actors)(using timeout: Timeout) extends MapReduce[T, K, V]

An abstract base class for MapReduce classes (other than MapReduceComposed).

Type parameters

K

output key type

K1M

the key type of the master's own protocol (Unit for a first stage, or K for a subsequent stage).

T

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

V

output value type

V1M

the value type of the master's own protocol (T for a first stage, or the V1 half of T for a subsequent stage).

Attributes

Graph
Supertypes
trait MapReduce[T, K, V]
trait AutoCloseable
trait Seq[T] => Future[Map[K, V]]
class Object
trait Matchable
class Any
Show all
Known subtypes
class MapReduce_LoggingBase[T, K1M, V1M, K1, V1]
class MapReduceFirst[V0, K1, W, V1]
class MapReduceFirstFold[V0, K1, W, V1]
class MapReducePipe[K0, V0, K1, W, V1]
class MapReducePipeFold[K0, V0, K1, W, V1]

Members list

Value members

Abstract methods

def createBehavior: Behavior[MasterCommand[K1M, V1M, K, V]]

Creates and returns the Behavior for the master actor.

Creates and returns the Behavior for the master actor.

Attributes

Returns

the Behavior used for actor creation

def logException(m: => String, x: Throwable): Unit

Logs the provided exception with an accompanying message.

Logs the provided exception with an accompanying message.

Value parameters

m

a lazily evaluated message string to provide context for the exception

x

the exception to be logged

Attributes

Returns

Unit, as the method performs a logging operation and does not return a value

def toMasterPair(t: T): (K1M, V1M)

Converts an input item of type T into the (key, value) pair the master's own protocol expects. For a first-stage MapReduce, this pairs T with a Unit key; for a subsequent stage, T already is the (K,V) pair the master expects.

Converts an input item of type T into the (key, value) pair the master's own protocol expects. For a first-stage MapReduce, this pairs T with a Unit key; for a subsequent stage, T already is the (K,V) pair the master expects.

Attributes

Concrete methods

def apply(ts: Seq[T]): Future[Map[K, V]]

Processes a sequence of input items, communicates with the master actor to retrieve results, and optionally reports the response. NOTE: currently, we ignore the value of report, but we could pass back a tuple that includes ok and the resulting map

Processes a sequence of input items, communicates with the master actor to retrieve results, and optionally reports the response. NOTE: currently, we ignore the value of report, but we could pass back a tuple that includes ok and the resulting map

Value parameters

ts

the sequence of input items to be processed

Attributes

Returns

a Future containing a map of key-value pairs representing the computed results

def close(): Unit

Stops the master actor (and, transitively, its mapper and reducer children) to release resources and terminate associated processes.

Stops the master actor (and, transitively, its mapper and reducer children) to release resources and terminate associated processes.

Attributes

Returns

Unit, as the method performs an action and does not produce a value.

def createName: Option[String]

This probably ought to be configured according to whether or not we are debugging

This probably ought to be configured according to whether or not we are debugging

Attributes

Inherited methods

def &[K2, V2](mr: MapReduce[(K, V), 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[(K, V)] => 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[K, V] => 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[K, V]] => 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[K, V]]

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
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[K, V] => 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

Givens

Givens

given ec: ExecutionContext

Attributes

Returns

a suitable execution context