IFilterTrackingNotifyingChangeApplierTarget::GetFilterForgottenKnowledge Method

When overridden in a derived class, gets the specified filter forgotten knowledge of the replica.

Namespace:  Microsoft.Synchronization
Assembly:  Microsoft.Synchronization (in Microsoft.Synchronization.dll)

ForgottenKnowledge^ GetFilterForgottenKnowledge(
	unsigned int filterIndex
)

Parameters

filterIndex
Type: System::UInt32
The filter key of the filter that is associated with the filter forgotten knowledge to look up.

Return Value

Type: Microsoft.Synchronization::ForgottenKnowledge
The filter forgotten knowledge that is associated with the filter identified by filterIndex. This value can be a nullptr when the filter forgotten knowledge is the same as the forgotten knowledge of the replica.

A replica tracks a filter when it stores metadata that indicates whether an item is in the filter, and whether an item has been in the filter but has moved out. The replica might also contain filter forgotten knowledge for the filter, if it has removed metadata that tracks whether an item has been in the filter but has moved out, or if the replica does not track the filter the first time it synchronizes with a filtered replica and begins tracking the filter at a later time.

The following example uses a FilterKeyMap object to retrieve the requested filter forgotten knowledge.

Public Function GetFilterForgottenKnowledge(ByVal filterIndex As UInteger) As ForgottenKnowledge Implements IFilteredReplicaNotifyingChangeApplierTarget.GetFilterForgottenKnowledge
    If filterIndex < _filterKeyMap.Count Then
        Return DirectCast(_filterKeyMap(CInt(filterIndex)), AddressFilter).FilterForgottenKnowledge
    Else
        Throw New ArgumentOutOfRangeException("GetFilterForgottenKnowledge received and out-of-range index.")
    End If
End Function


public ForgottenKnowledge GetFilterForgottenKnowledge(uint filterIndex)
{
    if (filterIndex < _filterKeyMap.Count)
    {
        return ((AddressFilter)_filterKeyMap[(int)filterIndex]).FilterForgottenKnowledge;
    }
    else
    {
        throw new ArgumentOutOfRangeException("GetFilterForgottenKnowledge received and out-of-range index.");
    }
}


Show: