Interface ICombiner
Interface to implement Combiner for MapReduce.
Namespace:
Assembly: Alachisoft.NCache.Runtime.dll
Syntax
public interface ICombiner : IDisposable
BeginCombine()
Any Intialization for the parameters before actual combining begins.
Declaration
void BeginCombine()
Examples
Following code demonstrates implementation of BeginCombine method.
int count=0;
public void BeginCombine()
{
//Initialize
}
Combine(Object)
Combines the task results locally so Reducer is not burdened with excessive processing.
Declaration
void Combine(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | Value for making grouped data for reducer. |
Examples
Following example demostrates how to implement Combine.
public void Combine(object value)
{
count += int.Parse(value.ToString());
}
FinishChunk()
When some specified chunk size is reached, combiners marks the functionality end on that chunk and send it to Reducer for further processing. And resets its internal state for next chunk.
Declaration
object FinishChunk()
Returns
Type | Description |
---|---|
System.Object | Sends the chunk to Reducer. |
Examples
Following example demostrates how to implement FinishChunk.
public object FinishChunk()
{
return count;
}