Share via


IReplicaMetadata2::GetFilteredFullEnumerationChangeBatch

Gets a filtered change batch that contains item metadata for items that have IDs greater than or equal to the specified lower bound, as part of a full enumeration.

HRESULT GetFilteredFullEnumerationChangeBatch(
  DWORD dwBatchSize,
  ISyncFilterInfo * pFilterInfo,
  IChangeBatchCallback * pCallback,
  const BYTE * pbLowerFullEnumerationBound,
  ISyncKnowledge * pSyncKnowledge,
  ISyncFullEnumerationChangeBatch ** ppChangeBatch);

Parameters

  • dwBatchSize
    [in] The size of the change batch to return.
  • pFilterInfo
    [in] An ISyncFilterInfo object that represents information about a filter that can be used to control which changes are included in a change batch.
  • pCallback
    [in, unique] An IChangeBatchCallback object that is used to determine whether to include an item in a change batch.
  • pbLowerFullEnumerationBound
    [in] The lower bound for item IDs. This method returns changes with IDs greater than or equal to this ID value if they satisfy the filter criteria specified in pFilterInfo.
  • pSyncKnowledge
    [in] The knowledge of the destination replica.
  • ppChangeBatch
    [out] Returns the batch of changes.

Return Value

  • S_OK.

  • E_POINTER.

  • E_INVALIDARG when dwBatchSize is 0.

Remarks

This method helps a synchronization provider implement its IKnowledgeSyncProvider::GetFullEnumerationChangeBatch method when item filtering is used. This method is called during forgotten knowledge recovery.

Before providers call this method, they must ensure that the versions in the metadata store reflect all local changes, including deletes. This is achieved by an explicit metadata maintenance pass to enumerate items and update their metadata.

The implementation of this class that is available through ISqlSyncMetadataStore performs the following functions:

  • Adds changes to the change batch in global ID order.

  • Returns all items that are not contained in pSyncKnowledge if they have IDs less than pbLowerEnumerationBound, and satisfy the filter criteria specified in pFilterInfo.

  • Calls SetLastBatch on the returned change batch when there are no more changes to send.

Notes for Implementers

This method must enumerate, in sorted order by item ID, changes that have an item ID of pbLowerEnumerationBound or greater and satisfy the filter criteria specified in pFilterInfo. This enables Sync Framework to determine which items on the destination provider have been deleted but forgotten by the source provider.

If there are no more changes to send after this batch, SetLastBatch must be called on the returned change batch, or Sync Framework will call IKnowledgeSyncProvider::GetFullEnumerationChangeBatch again to retrieve another batch of changes.

For a provider that sends item data along with item change metadata, pSyncKnowledge can be used to determine whether it is necessary to send item data. Item data does not have to be sent when the item change is contained in pSyncKnowledge.

See Also

Reference

IReplicaMetadata2 Interface