Freigeben über


BlobRequestOptions.LocationMode Eigenschaft

Definition

Ruft den Positionsmodus der Anforderung ab oder legt ihn fest.

public Microsoft.Azure.Storage.RetryPolicies.LocationMode? LocationMode { get; set; }
member this.LocationMode : Nullable<Microsoft.Azure.Storage.RetryPolicies.LocationMode> with get, set
Public Property LocationMode As Nullable(Of LocationMode)

Eigenschaftswert

Ein LocationMode-Enumerationswert, der den Positionsmodus der Anforderung angibt.

Implementiert

Beispiele

// The PrimaryOnly LocationMode directs the request and all potential retries to go to the primary endpoint.
BlobRequestOptions locationModeRequestOptions = new BlobRequestOptions() { LocationMode = RetryPolicies.LocationMode.PrimaryOnly };
byteCount = blob.DownloadToByteArray(destinationArray, index: 0, accessCondition: null, options: locationModeRequestOptions);

// The PrimaryThenSecondary LocationMode directs the first request to go to the primary location.
// If this request fails with a retryable error, the retry will next hit the secondary location.
// Retries will switch back and forth between primary and secondary until the request succeeds, 
// or retry attempts have been exhausted.
locationModeRequestOptions = new BlobRequestOptions() { LocationMode = RetryPolicies.LocationMode.PrimaryThenSecondary };
byteCount = blob.DownloadToByteArray(destinationArray, index: 0, accessCondition: null, options: locationModeRequestOptions);

// The SecondaryOnly LocationMode directs the request and all potential retries to go to the secondary endpoint.
locationModeRequestOptions = new BlobRequestOptions() { LocationMode = RetryPolicies.LocationMode.SecondaryOnly };
byteCount = blob.DownloadToByteArray(destinationArray, index: 0, accessCondition: null, options: locationModeRequestOptions);

// The SecondaryThenPrimary LocationMode directs the first request to go to the secondary location.
// If this request fails with a retryable error, the retry will next hit the primary location.
// Retries will switch back and forth between secondary and primary until the request succeeds, or retry attempts
// have been exhausted.
locationModeRequestOptions = new BlobRequestOptions() { LocationMode = RetryPolicies.LocationMode.SecondaryThenPrimary };
byteCount = blob.DownloadToByteArray(destinationArray, index: 0, accessCondition: null, options: locationModeRequestOptions);

Hinweise

Der LocationMode gibt an, an welchen Speicherorten der Speicherclient versucht, die Anforderung zu stellen. Dies gilt nur für RA-GRS-Konten– Konten, bei denen Daten entweder vom primären oder vom sekundären Endpunkt gelesen werden können.

Gilt für: