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 class
private final class
private final class
(package private) static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BackoffPolicy.Provider
private final LoadBalancer.Factory
private static final Logger
private 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 aLoadBalancer
that 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.Factory
Creates aLoadBalancer
that will be used inside a channel.- Specified by:
newLoadBalancer
in classLoadBalancer.Factory
-