MBrace.Flow


CloudFlow

Namespace: MBrace.Flow

Provides basic operations on CloudFlows.

Functions and values

Function or valueDescription
average(source)
Signature: source:CloudFlow<^T> -> Cloud<^T>
Type parameters: ^T

Computes the average of the elements in the input flow.

averageBy(projection source)
Signature: projection:('T -> ^U) -> source:CloudFlow<'T> -> Cloud<^U>
Type parameters: 'T, ^U

Computes the average of the projections given by the supplied function on the input flow.

averageByKey(...)
Signature: keyProjection:('T -> 'Key) -> valueProjection:('T -> ^Value) -> source:CloudFlow<'T> -> CloudFlow<'Key * ^Value>
Type parameters: 'T, 'Key, ^Value

Applies a key-generating function to each element of the input flow and computes the average of the projections in each group.

cache(flow)
Signature: flow:CloudFlow<'T> -> Cloud<PersistedCloudFlow<'T>>
Type parameters: 'T

Creates a PersistedCloudFlow from the given CloudFlow.

choose(chooser flow)
Signature: chooser:('T -> 'R option) -> flow:CloudFlow<'T> -> CloudFlow<'R>
Type parameters: 'T, 'R

Applies the given chooser function to each element of the input CloudFlow and returns a CloudFlow yielding each element where the function returns Some value

collect(f flow)
Signature: f:('T -> 'b) -> flow:CloudFlow<'T> -> CloudFlow<'R>
Type parameters: 'T, 'b, 'R

Transforms each element of the input CloudFlow to a new sequence and flattens its elements.

countBy(projection flow)
Signature: projection:('T -> 'Key) -> flow:CloudFlow<'T> -> CloudFlow<'Key * int64>
Type parameters: 'T, 'Key

Applies a key-generating function to each element of a CloudFlow and return a CloudFlow yielding unique keys and their number of occurrences in the original sequence.

distinct(source)
Signature: source:CloudFlow<'T> -> CloudFlow<'T>
Type parameters: 'T

Returns a flow that contains no duplicate elements according to their generic hash and equality comparisons. If an element occurs multiple times in the flow then only one is retained.

distinctBy(projection source)
Signature: projection:('T -> 'Key) -> source:CloudFlow<'T> -> CloudFlow<'T>
Type parameters: 'T, 'Key

Returns a flow that contains no duplicate entries according to the generic hash and equality comparisons on the keys returned by the given key-generating function. If an element occurs multiple times in the flow then only one is retained.

exists(predicate flow)
Signature: predicate:('T -> bool) -> flow:CloudFlow<'T> -> Cloud<bool>
Type parameters: 'T

Tests if any element of the flow satisfies the given predicate.

filter(predicate flow)
Signature: predicate:('T -> bool) -> flow:CloudFlow<'T> -> CloudFlow<'T>
Type parameters: 'T

Filters the elements of the input CloudFlow.

find(predicate flow)
Signature: predicate:('T -> bool) -> flow:CloudFlow<'T> -> Cloud<'T>
Type parameters: 'T

Returns the first element for which the given function returns true. Raises KeyNotFoundException if no such element exists.

fold(folder combiner state flow)
Signature: folder:('State -> 'T -> 'State) -> combiner:('State -> 'State -> 'State) -> state:(unit -> 'State) -> flow:CloudFlow<'T> -> Cloud<'State>
Type parameters: 'State, 'T

Applies a function to each element of the CloudFlow, threading an accumulator argument through the computation. If the input function is f and the elements are i0...iN, then this function computes f (... (f s i0)...) iN.

foldBy(...)
Signature: projection:('T -> 'Key) -> folder:('State -> 'T -> 'State) -> combiner:('State -> 'State -> 'State) -> state:(unit -> 'State) -> flow:CloudFlow<'T> -> CloudFlow<'Key * 'State>
Type parameters: 'T, 'Key, 'State

Applies a key-generating function to each element of a CloudFlow and return a CloudFlow yielding unique keys and the result of the threading an accumulator.

forall(predicate flow)
Signature: predicate:('T -> bool) -> flow:CloudFlow<'T> -> Cloud<bool>
Type parameters: 'T

Tests if all elements of the parallel flow satisfy the given predicate.

fullOuterJoin(...)
Signature: leftProjection:('T -> 'Key) -> rightProjection:('R -> 'Key) -> rightSource:CloudFlow<'R> -> leftSource:CloudFlow<'T> -> CloudFlow<'Key * 'T option * 'R option>
Type parameters: 'T, 'Key, 'R

Applies a key-generating functions to each element of the flows and yields a flow of unique keys and optional values of the right flow together with the optional values of the left flow that match the key.

groupBy(projection source)
Signature: projection:('T -> 'Key) -> source:CloudFlow<'T> -> CloudFlow<'Key * seq<'T>>
Type parameters: 'T, 'Key

Applies a key-generating function to each element of the input flow and yields a flow of unique keys and a sequence of all elements that have each key.

Note: This combinator may be very expensive; for example if the group sizes are expected to be large. If you intend to perform an aggregate operation, such as sum or average, you are advised to use CloudFlow.foldBy or CloudFlow.countBy, for much better performance.

groupJoinBy(...)
Signature: firstProjection:('T -> 'Key) -> secondProjection:('R -> 'Key) -> secondSource:CloudFlow<'R> -> firstSource:CloudFlow<'T> -> CloudFlow<'Key * seq<'T> * seq<'R>>
Type parameters: 'T, 'Key, 'R

Applies a key-generating functions to each element of the flows and yields a flow of unique keys and sequences of all elements that have each key.

isEmpty(flow)
Signature: flow:CloudFlow<'T> -> Cloud<bool>
Type parameters: 'T

Returs true if the flow is empty and false otherwise.

iter(action flow)
Signature: action:('T -> unit) -> flow:CloudFlow<'T> -> Cloud<unit>
Type parameters: 'T

Runs the action on each element. The actions are not necessarily performed in order.

join(...)
Signature: firstProjection:('T -> 'Key) -> secondProjection:('R -> 'Key) -> secondSource:CloudFlow<'R> -> firstSource:CloudFlow<'T> -> CloudFlow<'Key * 'T * 'R>
Type parameters: 'T, 'Key, 'R

Applies a key-generating functions to each element of the flows and yields a flow of unique keys and elements that have each key.

leftOuterJoin(...)
Signature: leftProjection:('T -> 'Key) -> rightProjection:('R -> 'Key) -> rightSource:CloudFlow<'R> -> leftSource:CloudFlow<'T> -> CloudFlow<'Key * 'T * 'R option>
Type parameters: 'T, 'Key, 'R

Applies a key-generating functions to each element of the flows and yields a flow of unique keys and elements of the left flow together with the optional values of the right flow that match the key.

length(flow)
Signature: flow:CloudFlow<'T> -> Cloud<int64>
Type parameters: 'T

Returns the total number of elements of the CloudFlow.

map(f flow)
Signature: f:('T -> 'R) -> flow:CloudFlow<'T> -> CloudFlow<'R>
Type parameters: 'T, 'R

Transforms each element of the input CloudFlow.

maxBy(projection flow)
Signature: projection:('T -> 'Key) -> flow:CloudFlow<'T> -> Cloud<'T>
Type parameters: 'T, 'Key

Locates the maximum element of the flow by given key.

minBy(projection flow)
Signature: projection:('T -> 'Key) -> flow:CloudFlow<'T> -> Cloud<'T>
Type parameters: 'T, 'Key

Locates the minimum element of the flow by given key.

peek(f flow)
Signature: f:('T -> LocalCloud<unit>) -> flow:CloudFlow<'T> -> CloudFlow<'T>
Type parameters: 'T

Enables the insertion of a monadic side-effect in a distributed flow. Output remains the same.

persist(storageLevel flow)
Signature: storageLevel:StorageLevel -> flow:CloudFlow<'T> -> Cloud<PersistedCloudFlow<'T>>
Type parameters: 'T

Creates a PersistedCloudFlow from the given CloudFlow, with its partitions cached to local memory.

pick(chooser flow)
Signature: chooser:('T -> 'R option) -> flow:CloudFlow<'T> -> Cloud<'R>
Type parameters: 'T, 'R

Applies the given function to successive elements, returning the first result where the function returns a Some value. Raises KeyNotFoundException when every item of the cloud flow evaluates to None when the given function is applied.

reduce(reducer flow)
Signature: reducer:('T -> 'T -> 'T) -> flow:CloudFlow<'T> -> Cloud<'T>
Type parameters: 'T

Reduces the elements of the input flow to a single value via the given reducer function. The reducer function is first applied to the first two elements of the flow. Then, the reducer is applied on the result of the first reduction and the third element.

reduceBy(projection reducer source)
Signature: projection:('T -> 'Key) -> reducer:('T -> 'T -> 'T) -> source:CloudFlow<'T> -> CloudFlow<'Key * 'T>
Type parameters: 'T, 'Key

Groups the elements of the input flow according to given key generating function and reduces the elements of each group to a single value via the given reducer function.

rightOuterJoin(...)
Signature: leftProjection:('T -> 'Key) -> rightProjection:('R -> 'Key) -> rightSource:CloudFlow<'R> -> leftSource:CloudFlow<'T> -> CloudFlow<'Key * 'T option * 'R>
Type parameters: 'T, 'Key, 'R

Applies a key-generating functions to each element of the flows and yields a flow of unique keys and elements of the right flow together with the optional values of the left flow that match the key.

sortBy(projection takeCount flow)
Signature: projection:('T -> 'Key) -> takeCount:int -> flow:CloudFlow<'T> -> CloudFlow<'T>
Type parameters: 'T, 'Key

Applies a key-generating function to each element of the input CloudFlow and yields the CloudFlow of the given length, ordered by keys.

sortByDescending(...)
Signature: projection:('T -> 'Key) -> takeCount:int -> flow:CloudFlow<'T> -> CloudFlow<'T>
Type parameters: 'T, 'Key

Applies a key-generating function to each element of the input CloudFlow and yields the CloudFlow of the given length, ordered descending by keys.

sortByUsing(...)
Signature: projection:('T -> 'Key) -> comparer:IComparer<'Key> -> takeCount:int -> flow:CloudFlow<'T> -> CloudFlow<'T>
Type parameters: 'T, 'Key

Applies a key-generating function to each element of the input CloudFlow and yields the CloudFlow of the given length, ordered using the given comparer for the keys.

sum(flow)
Signature: flow:CloudFlow<^T> -> Cloud<^T>
Type parameters: ^T

Returns the sum of the elements.

sumBy(projection flow)
Signature: projection:('T -> ^b) -> flow:CloudFlow<'T> -> Cloud<^S>
Type parameters: 'T, ^b, ^S

Applies a key-generating function to each element of a CloudFlow and return the sum of the keys.

sumByKey(...)
Signature: keyProjection:('T -> 'Key) -> valueProjection:('T -> ^Value) -> source:CloudFlow<'T> -> CloudFlow<'Key * ^Value>
Type parameters: 'T, 'Key, ^Value

Applies a key-generating function to each element of the input flow and computes the sum of the projections in each group.

take(n flow)
Signature: n:int -> flow:CloudFlow<'T> -> CloudFlow<'T>
Type parameters: 'T

Returns the elements of a CloudFlow up to a specified count.

toArray(flow)
Signature: flow:CloudFlow<'T> -> Cloud<'T []>
Type parameters: 'T

Creates an array from the given CloudFlow.

toCloudQueue(queue flow)
Signature: queue:CloudQueue<'T> -> flow:CloudFlow<'T> -> Cloud<unit>
Type parameters: 'T

Sends the values of CloudFlow to the SendPort of a CloudQueue

toTextCloudFiles(dirPath flow)
Signature: dirPath:string -> flow:CloudFlow<string> -> Cloud<CloudFileInfo []>

Returns an array of line separated CloudFiles from the given CloudFlow of strings.

tryFind(predicate flow)
Signature: predicate:('T -> bool) -> flow:CloudFlow<'T> -> Cloud<'T option>
Type parameters: 'T

Returns the first element for which the given function returns true. Returns None if no such element exists.

tryPick(chooser flow)
Signature: chooser:('T -> 'R option) -> flow:CloudFlow<'T> -> Cloud<'R option>
Type parameters: 'T, 'R

Applies the given function to successive elements, returning the first result where the function returns a Some value.

withDegreeOfParallelism(...)
Signature: degreeOfParallelism:int -> flow:CloudFlow<'T> -> CloudFlow<'T>
Type parameters: 'T

Returns a cloud flow with a new degree of parallelism.

Fork me on GitHub