public class RpcBehaviorLoadBalancerProvider
extends io.grpc.LoadBalancerProvider
LoadBalancer designed to work with XdsTestServer. It
looks for an "rpc_behavior" field in its configuration and includes the value in the
"rpc-behavior" metadata entry that is sent to the server. This will cause the test server to
behave in a predefined way. Endpoint picking logic is delegated to the
io.grpc.util.RoundRobinLoadBalancer.
Initial use case is to prove that a custom load balancer can be configured by the control plane via xDS. An interop test will configure this LB and then verify it has been correctly configured by observing a specific RPC behavior by the server(s).
For more details on what behaviors can be specified, please see: https://github.com/grpc/grpc/blob/master/doc/xds-test-descriptions.md#server
| Constructor and Description |
|---|
RpcBehaviorLoadBalancerProvider() |
| Modifier and Type | Method and Description |
|---|---|
String |
getPolicyName() |
int |
getPriority() |
boolean |
isAvailable() |
io.grpc.LoadBalancer |
newLoadBalancer(io.grpc.LoadBalancer.Helper helper) |
io.grpc.NameResolver.ConfigOrError |
parseLoadBalancingPolicyConfig(Map<String,?> rawLoadBalancingPolicyConfig) |
public io.grpc.NameResolver.ConfigOrError parseLoadBalancingPolicyConfig(Map<String,?> rawLoadBalancingPolicyConfig)
parseLoadBalancingPolicyConfig in class io.grpc.LoadBalancerProviderpublic io.grpc.LoadBalancer newLoadBalancer(io.grpc.LoadBalancer.Helper helper)
newLoadBalancer in class io.grpc.LoadBalancer.Factorypublic boolean isAvailable()
isAvailable in class io.grpc.LoadBalancerProviderpublic int getPriority()
getPriority in class io.grpc.LoadBalancerProviderpublic String getPolicyName()
getPolicyName in class io.grpc.LoadBalancerProvider