public sealed class DirectedReadOptions.Types.ReplicaSelection : IMessage<DirectedReadOptions.Types.ReplicaSelection>, IEquatable<DirectedReadOptions.Types.ReplicaSelection>, IDeepCloneable<DirectedReadOptions.Types.ReplicaSelection>, IBufferMessage, IMessage
Reference documentation and code samples for the Google Cloud Spanner v1 API class DirectedReadOptions.Types.ReplicaSelection.
The directed read replica selector.
Callers must provide one or more of the following fields for replica
selection:
location - The location must be one of the regions within the
multi-region configuration of your database.
type - The type of the replica.
Some examples of using replica_selectors are:
location:us-east1 --> The "us-east1" replica(s) of any available type
will be used to process the request.
type:READ_ONLY --> The "READ_ONLY" type replica(s) in nearest
available location will be used to process the
request.
location:us-east1 type:READ_ONLY --> The "READ_ONLY" type replica(s)
in location "us-east1" will be used to process
the request.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe latest version of the \u003ccode\u003eDirectedReadOptions.Types.ReplicaSelection\u003c/code\u003e API is 5.0.0-beta05, with several older versions available for reference.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eDirectedReadOptions.Types.ReplicaSelection\u003c/code\u003e is a class within the Google Cloud Spanner v1 API used for selecting read replicas, implementing interfaces like \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, and \u003ccode\u003eIDeepCloneable\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThis class allows you to direct read requests to specific replicas based on their \u003ccode\u003elocation\u003c/code\u003e (region) and \u003ccode\u003etype\u003c/code\u003e, enabling selection of replicas within a multi-region database setup.\u003c/p\u003e\n"],["\u003cp\u003eYou must provide at least one of the fields \u003ccode\u003elocation\u003c/code\u003e or \u003ccode\u003etype\u003c/code\u003e to properly use replica selection, for example, you can specify \u003ccode\u003elocation:us-east1\u003c/code\u003e or \u003ccode\u003etype:READ_ONLY\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eReplicaSelection\u003c/code\u003e class contains properties such as \u003ccode\u003eLocation\u003c/code\u003e, which specifies the region, and \u003ccode\u003eType\u003c/code\u003e, which specifies the replica type, both of which can be used to serve requests.\u003c/p\u003e\n"]]],[],null,[]]