ExtensionMethodsAggregateTInput, TKey, TState, TOutput, TTime Method (StreamTInput, TTime, FuncTInput, TKey, FuncTInput, TState, FuncTState, TState, TState, FuncTKey, TState, TOutput, Boolean)Naiad Help

[This is preliminary documentation and is subject to change.]

Groups records using the supplied key selector, and applies the given aggregation function.

Namespace: Microsoft.Research.Naiad.Frameworks.Lindi
Assembly: Microsoft.Research.Naiad.Lindi (in Microsoft.Research.Naiad.Lindi.dll) Version: 0.5.0.0 (0.5.0.0)
Syntax

C#
public static Stream<TOutput, TTime> Aggregate<TInput, TKey, TState, TOutput, TTime>(
	this Stream<TInput, TTime> stream,
	Func<TInput, TKey> keySelector,
	Func<TInput, TState> stateSelector,
	Func<TState, TState, TState> combiner,
	Func<TKey, TState, TOutput> resultSelector,
	bool locallyCombine
)
where TTime : Object, Time<TTime>

Parameters

stream
Type: Microsoft.Research.NaiadStreamTInput, TTime
The input stream.
keySelector
Type: SystemFuncTInput, TKey
Function that extracts a key from each record.
stateSelector
Type: SystemFuncTInput, TState
Function that extracts from each record the state to be aggregated.
combiner
Type: SystemFuncTState, TState, TState
A function from current state and incoming update, to the new state.
resultSelector
Type: SystemFuncTKey, TState, TOutput
Function that transforms a key and final combined state to an output record.
locallyCombine
Type: SystemBoolean
If true, perform local aggregation on each worker before global aggregation.

Type Parameters

TInput
The type of the input records.
TKey
The key type.
TState
The intermediate state type.
TOutput
The type of the output records.
TTime
The type of timestamp on each record.

Return Value

Type: StreamTOutput, TTime
The stream of output records.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type StreamTInput, TTime. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference