azure-docs-sdk-java/docs-ref-autogen/system.fabric.StateProvider...

107 строки
13 KiB
YAML

### YamlMime:JavaType
methods:
- fullName: system.fabric.StateProvider.getCopyContext()
name: getCopyContext()
nameWithType: StateProvider.getCopyContext()
returns:
description: <p>Returns <xref uid="system.fabric.OperationDataStream" data-throw-if-not-resolved="false" data-raw-source="system.fabric.OperationDataStream"></xref>. </p>
type: <xref href="system.fabric.OperationDataStream?alt=system.fabric.OperationDataStream&text=OperationDataStream" data-throw-if-not-resolved="False"/>
summary: >-
<p>Obtains context on a Secondary replica after it is created and opened to send context to the Primary replica.</p>
<p>
<b>Remarks:</b>The Primary replica analyzes the context and sends back state via <xref uid="system.fabric.StateProvider.getCopyState(SequenceNumber,OperationDataStream)" data-throw-if-not-resolved="false" data-raw-source="system.fabric.StateProvider#getCopyState(SequenceNumber, OperationDataStream)"></xref> . <xref uid="system.fabric.StateProvider.getCopyContext()" data-throw-if-not-resolved="false" data-raw-source="system.fabric.StateProvider#getCopyContext()"></xref> is called on newly created, idle Secondary replicas and provides a mechanism to asynchronously establish a bidirectional conversation with the Primary replica. The Secondary replica sends <xref uid="system.fabric.OperationData" data-throw-if-not-resolved="false" data-raw-source="system.fabric.OperationData"></xref> objects with which the Primary replica can determine the progress of collecting context on the Secondary replica. The Primary replica responds by sending the required state back. See <xref uid="system.fabric.StateProvider.getCopyState(SequenceNumber,OperationDataStream)" data-throw-if-not-resolved="false" data-raw-source="system.fabric.StateProvider#getCopyState(SequenceNumber, OperationDataStream)"></xref> at the Primary replica for the other half of the exchange. For in-memory services, the <xref uid="system.fabric.StateProvider.getCopyContext()" data-throw-if-not-resolved="false" data-raw-source="system.fabric.StateProvider#getCopyContext()"></xref> method is not called, as the state of the Secondary replicas is known (they are empty and will require all of the state). </p>
syntax: public OperationDataStream getCopyContext()
uid: system.fabric.StateProvider.getCopyContext()
- fullName: system.fabric.StateProvider.getCopyState(SequenceNumber upToSequenceNumber, OperationDataStream copyContext)
name: getCopyState(SequenceNumber upToSequenceNumber, OperationDataStream copyContext)
nameWithType: StateProvider.getCopyState(SequenceNumber upToSequenceNumber, OperationDataStream copyContext)
parameters:
- description: <p>The maximum last sequence number (LSN) that should be placed in the copy stream via the <xref uid="system.fabric.StateReplicator.getCopyStream()" data-throw-if-not-resolved="false" data-raw-source="system.fabric.StateReplicator#getCopyStream()"></xref> method. LSNs greater than this number are delivered to the Secondary replica as a part of the replication stream via the <xref uid="system.fabric.StateReplicator.getReplicationStream()" data-throw-if-not-resolved="false" data-raw-source="system.fabric.StateReplicator#getReplicationStream()"></xref> method. </p>
name: upToSequenceNumber
type: <xref href="system.fabric.SequenceNumber?alt=system.fabric.SequenceNumber&text=SequenceNumber" data-throw-if-not-resolved="False"/>
- description: <p>An <xref uid="system.fabric.OperationDataStream" data-throw-if-not-resolved="false" data-raw-source="system.fabric.OperationDataStream"></xref> that contains the <xref uid="system.fabric.OperationData" data-throw-if-not-resolved="false" data-raw-source="system.fabric.OperationData"></xref> objects that are created by the Secondary replica. requires to catch up to the provided </p>
name: copyContext
type: <xref href="system.fabric.OperationDataStream?alt=system.fabric.OperationDataStream&text=OperationDataStream" data-throw-if-not-resolved="False"/>
returns:
description: <p>Returns <xref uid="system.fabric.OperationDataStream" data-throw-if-not-resolved="false" data-raw-source="system.fabric.OperationDataStream"></xref>. </p>
type: <xref href="system.fabric.OperationDataStream?alt=system.fabric.OperationDataStream&text=OperationDataStream" data-throw-if-not-resolved="False"/>
summary: >-
<p>Obtains state on a Primary replica that is required to build a Secondary replica.</p>
<p>
<b>Remarks:</b>Just as <xref uid="system.fabric.StateProvider.getCopyContext()" data-throw-if-not-resolved="false" data-raw-source="system.fabric.StateProvider#getCopyContext()"></xref> enables the Secondary replica to send context to the Primary replica via an <xref uid="system.fabric.OperationDataStream" data-throw-if-not-resolved="false" data-raw-source="system.fabric.OperationDataStream"></xref>, <xref uid="system.fabric.StateProvider.getCopyState(SequenceNumber,OperationDataStream)" data-throw-if-not-resolved="false" data-raw-source="system.fabric.StateProvider#getCopyState(SequenceNumber, OperationDataStream)"></xref> enables the Primary replica to respond with an <xref uid="system.fabric.OperationDataStream" data-throw-if-not-resolved="false" data-raw-source="system.fabric.OperationDataStream"></xref>. The stream contains objects that are delivered to the Secondary replica via the <xref uid="system.fabric.StateReplicator.getCopyStream()" data-throw-if-not-resolved="false" data-raw-source="system.fabric.StateReplicator#getCopyStream()"></xref> method of the <xref uid="system.fabric.FabricReplicator" data-throw-if-not-resolved="false" data-raw-source="system.fabric.FabricReplicator"></xref> class. The objects implement <xref uid="system.fabric.Operation" data-throw-if-not-resolved="false" data-raw-source="system.fabric.Operation"></xref> and contain the specified data. When the Primary replica receives this call, it should create and return another <xref uid="system.fabric.OperationDataStream" data-throw-if-not-resolved="false" data-raw-source="system.fabric.OperationDataStream"></xref> that contains <xref uid="system.fabric.OperationData" data-throw-if-not-resolved="false" data-raw-source="system.fabric.OperationData"></xref>. <xref uid="system.fabric.OperationData" data-throw-if-not-resolved="false" data-raw-source="system.fabric.OperationData"></xref> represents the data/state that the Secondary replica </p>
syntax: public OperationDataStream getCopyState(SequenceNumber upToSequenceNumber, OperationDataStream copyContext)
uid: system.fabric.StateProvider.getCopyState(SequenceNumber,OperationDataStream)
- fullName: system.fabric.StateProvider.getLastCommittedSequenceNumber()
name: getLastCommittedSequenceNumber()
nameWithType: StateProvider.getLastCommittedSequenceNumber()
returns:
description: <p>Returns long. </p>
type: <xref href="long?alt=long&text=long" data-throw-if-not-resolved="False"/>
summary: >-
<p>Obtains the last sequence number that the service has committed.</p>
<p></p>
syntax: public long getLastCommittedSequenceNumber()
uid: system.fabric.StateProvider.getLastCommittedSequenceNumber()
- fullName: system.fabric.StateProvider.onDataLossAsync(CancellationToken cancellationToken)
name: onDataLossAsync(CancellationToken cancellationToken)
nameWithType: StateProvider.onDataLossAsync(CancellationToken cancellationToken)
parameters:
- description: >-
<p>
<xref uid="system.fabric.CancellationToken" data-throw-if-not-resolved="false" data-raw-source="system.fabric.CancellationToken"></xref> object to indicate the cancellation status of the operation. </p>
name: cancellationToken
type: <xref href="system.fabric.CancellationToken?alt=system.fabric.CancellationToken&text=CancellationToken" data-throw-if-not-resolved="False"/>
returns:
description: <p>Returns <xref uid="" data-throw-if-not-resolved="false" data-raw-source="CompletableFuture"></xref> of type <xref uid="" data-throw-if-not-resolved="false" data-raw-source="java.lang.Boolean"></xref>, that indicates whether the state provider as part of processing this notification has changed its state </p>
type: <xref href="CompletableFuture%3CBoolean%3E?alt=CompletableFuture%3CBoolean%3E&text=CompletableFuture%3CBoolean%3E" data-throw-if-not-resolved="False"/>
summary: >-
<p>Indicates that a write quorum of replicas in this replica set has been lost, and that therefore data loss might have occurred. The replica set consists of a majority of replicas, which includes the Primary replica.</p>
<p>
<b>Remarks:</b>When the Service Fabric runtime observes the failure of a quorum of replicas, which includes the Primary replica, it elects a new Primary replica and immediately calls this method on the new Primary replica. A Primary replica that is informed of possible data loss can choose to restore its state from some external data source or can continue to run with the state that it currently has. If the service continues to run with its current state, it should return false from this method, which indicates that no state change has been made. If it has restored or altered its state, such as rolling back incomplete work, it should return true. If true is returned, then the state in other replicas must be assumed to be incorrect. Therefore, the Service Fabric runtime removes the other replicas from the replica set and recreates them. </p>
syntax: public CompletableFuture<Boolean> onDataLossAsync(CancellationToken cancellationToken)
uid: system.fabric.StateProvider.onDataLossAsync(CancellationToken)
- fullName: system.fabric.StateProvider.updateEpochAsync(Epoch epoch, SequenceNumber previousEpochLastSequenceNumber, CancellationToken cancellationToken)
name: updateEpochAsync(Epoch epoch, SequenceNumber previousEpochLastSequenceNumber, CancellationToken cancellationToken)
nameWithType: StateProvider.updateEpochAsync(Epoch epoch, SequenceNumber previousEpochLastSequenceNumber, CancellationToken cancellationToken)
parameters:
- description: <p>The new <xref uid="system.fabric.Epoch" data-throw-if-not-resolved="false" data-raw-source="system.fabric.Epoch"></xref>. </p>
name: epoch
type: <xref href="system.fabric.Epoch?alt=system.fabric.Epoch&text=Epoch" data-throw-if-not-resolved="False"/>
- description: <p>The maximum sequence number (LSN) in the previous epoch. </p>
name: previousEpochLastSequenceNumber
type: <xref href="system.fabric.SequenceNumber?alt=system.fabric.SequenceNumber&text=SequenceNumber" data-throw-if-not-resolved="False"/>
- description: >-
<p>
<xref uid="system.fabric.CancellationToken" data-throw-if-not-resolved="false" data-raw-source="system.fabric.CancellationToken"></xref> object to indicate the cancellation status of the operation. </p>
name: cancellationToken
type: <xref href="system.fabric.CancellationToken?alt=system.fabric.CancellationToken&text=CancellationToken" data-throw-if-not-resolved="False"/>
returns:
description: <p>Returns <xref uid="" data-throw-if-not-resolved="false" data-raw-source="CompletableFuture"></xref>. </p>
type: <xref href="CompletableFuture%3C%3F%3E?alt=CompletableFuture%3C%3F%3E&text=CompletableFuture%3C%3F%3E" data-throw-if-not-resolved="False"/>
summary: >-
<p>Indicates to a replica that the configuration of a replica set has changed due to a change or attempted change to the Primary replica. The change occurs due to failure or load balancing of the previous Primary replica. Epoch changes act as a barrier by segmenting operations into the exact configuration periods in which they were sent by a specific Primary replica.</p>
<p>
<b>Remarks:</b>The information in the <xref uid="system.fabric.StateProvider.updateEpochAsync(Epoch,SequenceNumber,CancellationToken)" data-throw-if-not-resolved="false" data-raw-source="system.fabric.StateProvider#updateEpochAsync(Epoch, SequenceNumber, CancellationToken)"></xref> method enables the service to maintain a progress vector, which is a list of each epoch that the replica has received, and the maximum LSN that they contained. The progress vector data along with the current applied maximum LSN is useful for a Secondary replica to send during the copy operation to describe the state of the replica. Comparing progress vectors that are received from Secondary replicas during the copy operation enables Primary replicas to determine whether the Secondary replica is up-to-date, what state must be sent to the Secondary replica, and whether the Secondary replica has made false progress. False progress means that a secondary replica reports an LSN in a previous epoch was greater than the LSN that the Primary replica has in its progress vector. </p>
syntax: public CompletableFuture<?> updateEpochAsync(Epoch epoch, SequenceNumber previousEpochLastSequenceNumber, CancellationToken cancellationToken)
uid: system.fabric.StateProvider.updateEpochAsync(Epoch,SequenceNumber,CancellationToken)
nameWithType: StateProvider
syntax: public interface StateProvider
type: interface
uid: system.fabric.StateProvider
fullName: system.fabric.StateProvider
name: StateProvider
package: system.fabric
summary: <p>Defines the behavior that a service must implement to interact with the <xref uid="system.fabric.FabricReplicator" data-throw-if-not-resolved="false" data-raw-source="FabricReplicator"></xref>. </p>
metadata: {}