Method FilterKey
FilterKey(Object)
Implement the interface IKeyFilter to provide implementation for the FilterKey() method. Providing this interface is optional.
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;
}
}