Class RpcBehaviorLoadBalancerProvider


  • public class RpcBehaviorLoadBalancerProvider
    extends io.grpc.LoadBalancerProvider
    Provides a xDS interop test 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 Detail

      • RpcBehaviorLoadBalancerProvider

        public RpcBehaviorLoadBalancerProvider()
    • Method Detail

      • parseLoadBalancingPolicyConfig

        public io.grpc.NameResolver.ConfigOrError parseLoadBalancingPolicyConfig​(java.util.Map<java.lang.String,​?> rawLoadBalancingPolicyConfig)
        Overrides:
        parseLoadBalancingPolicyConfig in class io.grpc.LoadBalancerProvider
      • newLoadBalancer

        public io.grpc.LoadBalancer newLoadBalancer​(io.grpc.LoadBalancer.Helper helper)
        Specified by:
        newLoadBalancer in class io.grpc.LoadBalancer.Factory
      • isAvailable

        public boolean isAvailable()
        Specified by:
        isAvailable in class io.grpc.LoadBalancerProvider
      • getPriority

        public int getPriority()
        Specified by:
        getPriority in class io.grpc.LoadBalancerProvider
      • getPolicyName

        public java.lang.String getPolicyName()
        Specified by:
        getPolicyName in class io.grpc.LoadBalancerProvider