Interface IReducer
Apply aggregation and compilation on final result.
Namespace:
Assembly: Alachisoft.NCache.Runtime.dll
Syntax
public interface IReducer : IDisposable
Methods
BeginReduce()
Starting point for initialization of reducer.
Declaration
void BeginReduce()
Examples
Following example illustrate the usage of BeginReduce.
public void BeginReduce()
{
// Initialization
}
FinishReduce()
Provides final result of map reduce task.
Declaration
KeyValuePair FinishReduce()
Returns
Type | Description |
---|---|
KeyValuePair | Return key-value pair. |
Examples
public KeyValuePair FinishReduce()
{
KeyValuePair kvp = null;
kvp.Key = key;
kvp.Value = count;
return kvp;
}
Reduce(Object)
Reduces the key-value pair to further meaning full pairs.
Declaration
void Reduce(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | Value for the specified key. |
Examples
Following example illustrate the usage of Reduce.
public void Reduce(object value)
{
count += int.Parse(value.ToString());
}