IStateProvider.GetCopyState(Int64, IOperationDataStream) Method

Definition

Obtains state on a primary replica that is required to build a secondary replica.

public System.Fabric.IOperationDataStream GetCopyState (long upToSequenceNumber, System.Fabric.IOperationDataStream copyContext);
abstract member GetCopyState : int64 * System.Fabric.IOperationDataStream -> System.Fabric.IOperationDataStream
Public Function GetCopyState (upToSequenceNumber As Long, copyContext As IOperationDataStream) As IOperationDataStream

Parameters

upToSequenceNumber
Int64

The maximum last sequence number that should be placed in the copy stream via the GetCopyStream() method. LSNs greater than this number are delivered to the secondary replica as a part of the replication stream via the GetReplicationStream() method.

copyContext
IOperationDataStream

An IOperationDataStream that contains the OperationData objects that are created by the secondary replica.

Returns

Returns IOperationDataStream.

Remarks

Just as GetCopyContext() enables the secondary replica to send context to the primary replica via an IOperationDataStream, GetCopyState(Int64, IOperationDataStream) enables the primary replica to respond with an IOperationDataStream. The stream contains objects that are delivered to the secondary replica via the GetCopyStream() method of the FabricReplicator class. The objects implement IOperation and contain the specified data.

When the primary replica receives this call, it should create and return another IOperationDataStream that contains OperationData. OperationData represents the data/state that the secondary replica requires to catch up to the provided upToSequenceNumber maximum LSN. How much and which state has to be sent can be determined via the context information that the secondary replica provides via GetCopyContext() method.

Applies to