Operation Interface

public interface Operation

Remarks:

system.fabric.Operation is the base interface that describes state changes that are delivered to a Secondary replica. They contain the replicateAsync(OperationData operationData, SequenceNumber sequenceNumber, CancellationToken cancellationToken) and the sequence number and other identifying information.

Method Summary

Modifier and Type Method and Description
void acknowledge()

Acknowledges that this operation has been successfully applied at the Secondary replica.

Remarks:Services should call this method when they have obtained an system.fabric.Operation from the replicator and successfully applied it to their local store. For persisted services, calling this method is mandatory because the FabricReplicator does not release additional objects that implement system.fabric.Operation. For volatile services, the replicator implicitly acknowledges operations when they are received unless they are configured otherwise by setting the value isRequireServiceAck() to true. An operation must be acknowledged by a quorum of replicas before the Primary replica receives the replicateAsync(OperationData operationData, SequenceNumber sequenceNumber, CancellationToken cancellationToken) operation complete responses.

long getAtomicGroupId()

Identifies the atomic group, if this object that implements system.fabric.Operation is a part of an atomic group. Atomic groups are only available when a service is a part of service group.

OperationData getData()

Gets the OperationData that are provided by the Primary replica.

OperationType getOperationType()

Gets the type of this operation.

Remarks:The OperationType indicates the type of operation. "Normal" operations are those operations that are sent by non-service grouped services as part of either the copy or replication streams. Other types of operations represent control operations that are specific to service groups.

long getSequenceNumber()

Gets the sequence number of this operation.

Remarks:The sequence number is provided as a part of the getSequenceNumber() For operations received from the replication stream (getReplicationStream()) the sequence number is the same that the Primary replica that are receives from replicateAsync(OperationData operationData, SequenceNumber sequenceNumber, CancellationToken cancellationToken) method.

Method Details

acknowledge

public void acknowledge()

Acknowledges that this operation has been successfully applied at the Secondary replica.

Remarks:Services should call this method when they have obtained an system.fabric.Operation from the replicator and successfully applied it to their local store. For persisted services, calling this method is mandatory because the FabricReplicator does not release additional objects that implement system.fabric.Operation. For volatile services, the replicator implicitly acknowledges operations when they are received unless they are configured otherwise by setting the value isRequireServiceAck() to true. An operation must be acknowledged by a quorum of replicas before the Primary replica receives the replicateAsync(OperationData operationData, SequenceNumber sequenceNumber, CancellationToken cancellationToken) operation complete responses.

getAtomicGroupId

public long getAtomicGroupId()

Identifies the atomic group, if this object that implements system.fabric.Operation is a part of an atomic group. Atomic groups are only available when a service is a part of service group.

Returns:

Returns long.

getData

public OperationData getData()

Gets the OperationData that are provided by the Primary replica.

Returns:

Returns OperationData.

getOperationType

public OperationType getOperationType()

Gets the type of this operation.

Remarks:The OperationType indicates the type of operation. "Normal" operations are those operations that are sent by non-service grouped services as part of either the copy or replication streams. Other types of operations represent control operations that are specific to service groups.

Returns:

Returns OperationType.

getSequenceNumber

public long getSequenceNumber()

Gets the sequence number of this operation.

Remarks:The sequence number is provided as a part of the getSequenceNumber() For operations received from the replication stream (getReplicationStream()) the sequence number is the same that the Primary replica that are receives from replicateAsync(OperationData operationData, SequenceNumber sequenceNumber, CancellationToken cancellationToken) method.

Returns:

Returns long.

Applies to