Package io.grpc.protobuf.services
Class HealthCheckingLoadBalancerFactory
java.lang.Object
io.grpc.LoadBalancer.Factory
io.grpc.protobuf.services.HealthCheckingLoadBalancerFactory
Wraps a
LoadBalancer and implements the client-side health-checking
(https://github.com/grpc/proposal/blob/master/A17-client-side-health-checking.md). The
Subchannel received by the states wrapped LoadBalancer will be determined by health-checking.
Note the original LoadBalancer must call Helper.createSubchannel() from the
SynchronizationContext, or it will throw.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classprivate final classprivate final class(package private) static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BackoffPolicy.Providerprivate final LoadBalancer.Factoryprivate static final Loggerprivate final com.google.common.base.Supplier<com.google.common.base.Stopwatch> -
Constructor Summary
ConstructorsConstructorDescriptionHealthCheckingLoadBalancerFactory(LoadBalancer.Factory delegateFactory, BackoffPolicy.Provider backoffPolicyProvider, com.google.common.base.Supplier<com.google.common.base.Stopwatch> stopwatchSupplier) -
Method Summary
Modifier and TypeMethodDescriptionnewLoadBalancer(LoadBalancer.Helper helper) Creates aLoadBalancerthat will be used inside a channel.
-
Field Details
-
logger
-
delegateFactory
-
backoffPolicyProvider
-
stopwatchSupplier
private final com.google.common.base.Supplier<com.google.common.base.Stopwatch> stopwatchSupplier
-
-
Constructor Details
-
HealthCheckingLoadBalancerFactory
public HealthCheckingLoadBalancerFactory(LoadBalancer.Factory delegateFactory, BackoffPolicy.Provider backoffPolicyProvider, com.google.common.base.Supplier<com.google.common.base.Stopwatch> stopwatchSupplier)
-
-
Method Details
-
newLoadBalancer
Description copied from class:LoadBalancer.FactoryCreates aLoadBalancerthat will be used inside a channel.- Specified by:
newLoadBalancerin classLoadBalancer.Factory
-