@@ -29,6 +29,9 @@ option java_outer_classname = "RlsConfigProto";
2929// present for the keybuilder to match.
3030message NameMatcher {
3131 // The name that will be used in the RLS key_map to refer to this value.
32+ // If required_match is true, you may omit this field or set it to an empty
33+ // string, in which case the matcher will require a match, but won't update
34+ // the key_map.
3235 string key = 1 ;
3336
3437 // Ordered list of names (headers or query parameter names) that can supply
@@ -52,10 +55,29 @@ message GrpcKeyBuilder {
5255 }
5356 repeated Name names = 1 ;
5457
58+ // If you wish to include the host, service, or method names as keys in the
59+ // generated RouteLookupRequest, specify key names to use in the extra_keys
60+ // submessage. If a key name is empty, no key will be set for that value.
61+ // If this submessage is specified, the normal host/path fields will be left
62+ // unset in the RouteLookupRequest. We are deprecating host/path in the
63+ // RouteLookupRequest, so services should migrate to the ExtraKeys approach.
64+ message ExtraKeys {
65+ string host = 1 ;
66+ string service = 2 ;
67+ string method = 3 ;
68+ }
69+ ExtraKeys extra_keys = 3 ;
70+
5571 // Extract keys from all listed headers.
5672 // For gRPC, it is an error to specify "required_match" on the NameMatcher
5773 // protos.
5874 repeated NameMatcher headers = 2 ;
75+
76+ // You can optionally set one or more specific key/value pairs to be added to
77+ // the key_map. This can be useful to identify which builder built the key,
78+ // for example if you are suppressing the actual method, but need to
79+ // separately cache and request all the matched methods.
80+ map <string , string > constant_keys = 4 ;
5981}
6082
6183// An HttpKeyBuilder applies to a given HTTP URL and headers.
@@ -131,6 +153,12 @@ message HttpKeyBuilder {
131153 // to match. If a given header appears multiple times in the request we will
132154 // report it as a comma-separated string, in standard HTTP fashion.
133155 repeated NameMatcher headers = 4 ;
156+
157+ // You can optionally set one or more specific key/value pairs to be added to
158+ // the key_map. This can be useful to identify which builder built the key,
159+ // for example if you are suppressing a lot of information from the URL, but
160+ // need to separately cache and request URLs with that content.
161+ map <string , string > constant_keys = 5 ;
134162}
135163
136164message RouteLookupConfig {
@@ -176,40 +204,15 @@ message RouteLookupConfig {
176204
177205 // This is a list of all the possible targets that can be returned by the
178206 // lookup service. If a target not on this list is returned, it will be
179- // treated the same as an RPC error from the RLS .
207+ // treated the same as an unhealthy target .
180208 repeated string valid_targets = 8 ;
181209
182- // This value provides a default target to use if needed. It will be used for
183- // request processing strategy SYNC_LOOKUP_DEFAULT_TARGET_ON_ERROR if RLS
184- // returns an error, or strategy ASYNC_LOOKUP_DEFAULT_TARGET_ON_MISS if RLS
185- // returns an error or there is a cache miss in the client. It will also be
186- // used if there are no healthy backends for an RLS target. Note that
187- // requests can be routed only to a subdomain of the original target,
188- // e.g. "us_east_1.cloudbigtable.googleapis.com".
210+ // This value provides a default target to use if needed. If set, it will be
211+ // used if RLS returns an error, times out, or returns an invalid response.
212+ // Note that requests can be routed only to a subdomain of the original
213+ // target, e.g. "us_east_1.cloudbigtable.googleapis.com".
189214 string default_target = 9 ;
190215
191- // Specify how to process a request when not already in the cache.
192- enum RequestProcessingStrategy {
193- STRATEGY_UNSPECIFIED = 0 ;
194-
195- // Query the RLS and process the request using target returned by the
196- // lookup. The target will then be cached and used for processing
197- // subsequent requests for the same key. Any errors during lookup service
198- // processing will fall back to default target for request processing.
199- SYNC_LOOKUP_DEFAULT_TARGET_ON_ERROR = 1 ;
200-
201- // Query the RLS and process the request using target returned by the
202- // lookup. The target will then be cached and used for processing
203- // subsequent requests for the same key. Any errors during lookup service
204- // processing will return an error back to the client. Services with
205- // strict regional routing requirements should use this strategy.
206- SYNC_LOOKUP_CLIENT_SEES_ERROR = 2 ;
207-
208- // Query the RLS asynchronously but respond with the default target. The
209- // target in the lookup response will then be cached and used for
210- // subsequent requests. Services with strict latency requirements (but not
211- // strict regional routing requirements) should use this strategy.
212- ASYNC_LOOKUP_DEFAULT_TARGET_ON_MISS = 3 ;
213- }
214- RequestProcessingStrategy request_processing_strategy = 10 ;
216+ reserved 10 ;
217+ reserved "request_processing_strategy" ;
215218}
0 commit comments