EagerDD

com.phasmid.majabigwaduce.dd.EagerDD
See theEagerDD companion object
case class EagerDD[K, V](kVs: Seq[(K, V)])(implicit ec: ExecutionContext) extends BaseDD[K, V], HasEvaluatedMap[K, V]

Case Class which implements DataDefinition[K, V] eagerly and which is based on a Map[K,V]. NOTE: this type serves as the appropriate result of evaluating a lazy DD. In that respect it is the equivalent of the array which is created when invoking collect on an RDD in Spark.

Type parameters

K

the key type

V

the input value type

Value parameters

ec

the (implicit) execution context

kVs

the actual data definition represented as a Map

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait HasEvaluatedMap[K, V]
class BaseDD[K, V]
trait DataDefinition[K, V]
trait () => Future[Map[K, V]]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def clean(): Unit

Clean up any residual resources from this DataDefinition. For an EagerDD, this is a no-op.

Clean up any residual resources from this DataDefinition. For an EagerDD, this is a no-op.

Attributes

def evalMap: Map[K, V]

Return the evaluated map as is

Return the evaluated map as is

Attributes

Returns

a Map[K,V]

def evaluate: Future[DataDefinition[K, V] & HasEvaluatedMap[K, V]]

Evaluate this EagerDD as a Future of DataDefinition[K,V] with HasEvaluatedMap[K, V]

Evaluate this EagerDD as a Future of DataDefinition[K,V] with HasEvaluatedMap[K, V]

Attributes

Returns

this wrapped in Future

def filter(p: ((K, V)) => Boolean): DataDefinition[K, V]

Method to filter this DataDefinition according to a predicate which takes a k-v tuple.

Method to filter this DataDefinition according to a predicate which takes a k-v tuple.

Value parameters

p

the predicate which will yield a Boolean for a given k-v tuple.

Attributes

Returns

a new DataDefinition containing only those k-v pairs which satisfy the predicate p.

def groupBy[L](f: V => L): DataDefinition[L, Iterable[V]]

Method to group values by a new key type generated from the values, ignoring the current keys.

Method to group values by a new key type generated from the values, ignoring the current keys.

CONSIDER simplifying the value passed to EagerDD

Type parameters

L

the new key type, whose values are derived from the values of this DataDefinition

Attributes

Returns

a DataDefinition based on L and Iterable[V]

def join[L >: K, W](other: DataDefinition[L, W])(using evidence$1: Monoid[W], timeout: Timeout): DataDefinition[L, (V, W)]

Join method to perform inner join.

Join method to perform inner join.

Type parameters

L

key type of other and also of the result

W

value type of other

Value parameters

other

the DataDefinition with which to join this

Attributes

Returns

the inner join of this and other

def map[L, W : Monoid](f: ((K, V)) => (L, W)): DataDefinition[L, W]

Method to form a new DataDefinition where the resulting values derive from applying the function f to the original values TESTME

Method to form a new DataDefinition where the resulting values derive from applying the function f to the original values TESTME

Type parameters

L

the underlying type of the keys of the resulting map

W

the underlying type of the values of the resulting map

Value parameters

f

the function to transform key-value pairs

Attributes

Returns

a new DataDefinition

Inherited methods

override def apply(): Future[Map[K, V]]

Evaluate this DataDefinition

Evaluate this DataDefinition

Attributes

Returns

a map of key-value pairs wrapped in Future

Definition Classes
BaseDD -> Function0
Inherited from:
BaseDD
def count: Future[Int]

Evaluate the number of elements in this DataDefinition

Evaluate the number of elements in this DataDefinition

Attributes

Returns

the number of k-v pairs

Inherited from:
BaseDD
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
def reduce[X : Zero](wVWf: (X, V) => X): Future[X]

Method to evaluate this DataDefinition and reduce the dimensionality of the result by ignoring the keys and aggregating the values according to the function xw_x.

Method to evaluate this DataDefinition and reduce the dimensionality of the result by ignoring the keys and aggregating the values according to the function xw_x.

Type parameters

X

the underlying type of the result.

Value parameters

wVWf

the aggregation function.

Attributes

Returns

an X value, wrapped in Future.

Inherited from:
BaseDD
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
Function0 -> Any
Inherited from:
Function0