Interface IKeyFilter
Allows user to filter the data before providing it to Mapper.
Namespace:
Assembly: Alachisoft.NCache.Runtime.dll
Syntax
public interface IKeyFilter
Methods
FilterKey(Object)
Map will be executed on specified key if ture is returned.
Declaration
bool FilterKey(object key)
Parameters
Type | Name | Description |
---|---|---|
System.Object | key | Key for filtering |
Returns
Type | Description |
---|---|
System.Boolean | Returns if map has to be applied or not. |
Examples
Following example illustrate the usage of FilterKey.
public class MapReduceKeyFilter : IKeyFilter
{
public bool FilterKey(object key)
{
try
{
if (key.ToString().Contains("hungry"))
{
return true;
}
}
catch (Exception exp)
{
//handle exception
}
return false;
}
}