| JobBuilderGroupAggregateTKey, TValue Method (IOperationInput, FuncTKey, TValue, TValue, TaskContext, TValue, Type, RecordReuseMode) |
Groups the input records by key, then aggregates their values using the specified accumulator task function.
Namespace:
Ookii.Jumbo.Jet.Jobs.Builder
Assembly:
Ookii.Jumbo.Jet (in Ookii.Jumbo.Jet.dll) Version: 2.0.0
Syntax public TwoStepOperation GroupAggregate<TKey, TValue>(
IOperationInput input,
Func<TKey, TValue, TValue, TaskContext, TValue> accumulator,
Type keyComparerType = null,
RecordReuseMode recordReuse = RecordReuseMode.Default
)
where TKey : Object, IComparable<TKey>
Public Function GroupAggregate(Of TKey As {Object, IComparable(Of TKey)}, TValue) (
input As IOperationInput,
accumulator As Func(Of TKey, TValue, TValue, TaskContext, TValue),
Optional keyComparerType As Type = Nothing,
Optional recordReuse As RecordReuseMode = RecordReuseMode.Default
) As TwoStepOperation
public:
generic<typename TKey, typename TValue>
where TKey : Object, IComparable<TKey>
TwoStepOperation^ GroupAggregate(
IOperationInput^ input,
Func<TKey, TValue, TValue, TaskContext^, TValue>^ accumulator,
Type^ keyComparerType = nullptr,
RecordReuseMode recordReuse = RecordReuseMode::Default
)
member GroupAggregate :
input : IOperationInput *
accumulator : Func<'TKey, 'TValue, 'TValue, TaskContext, 'TValue> *
?keyComparerType : Type *
?recordReuse : RecordReuseMode
(* Defaults:
let _keyComparerType = defaultArg keyComparerType null
let _recordReuse = defaultArg recordReuse RecordReuseMode.Default
*)
-> TwoStepOperation when 'TKey : Object and IComparable<'TKey>
Parameters
- input
- Type: Ookii.Jumbo.Jet.Jobs.BuilderIOperationInput
The input. - accumulator
- Type: SystemFuncTKey, TValue, TValue, TaskContext, TValue
The accumulator function to use to create the task. - keyComparerType (Optional)
- Type: SystemType
Type of the IEqualityComparerT to use to compare the aggregation keys,
or to use Default. May be a generic type definition with one type parameter, which will be set to the key type. - recordReuse (Optional)
- Type: Ookii.Jumbo.Jet.Jobs.BuilderRecordReuseMode
The record reuse mode.
Type Parameters
- TKey
- The type of the key.
- TValue
- The type of the value.
Return Value
Type:
TwoStepOperationA
TwoStepOperation instance that can be used to further customize the operation.
Remarks
This method generates a class implementing AccumulatorTaskTKey, TValue which calls the target method of the accumulator delegate
from the Accumulate(TKey, TValue, TValue) method.
Note |
---|
The task method will be called from a completely different process than the one that is using JobBuilder, so it should not really
on any external state.
|
If recordReuse is Default and the target method has the AllowRecordReuseAttribute attribute applied to it,
that attribute will be copied to the task class. If the target method has the ProcessAllInputPartitionsAttribute attribute applied to it,
that attribute will be copied to the task class.
If the target method is a public method, it will be called directly by the generated task class. Otherwise, the supplied
delegate will be serialized to the task settings and used to call the method. If the target method is an instance method, the instance it belongs to will be
serialized as well (this class must have the SerializableAttribute attribute).
See Also