Package io.servicetalk.loadbalancer
Class RoundRobinLoadBalancerFactory<ResolvedAddress,C extends LoadBalancedConnection>
java.lang.Object
io.servicetalk.loadbalancer.RoundRobinLoadBalancerFactory<ResolvedAddress,C>
- Type Parameters:
ResolvedAddress- The resolved address type.C- The type of connection.
- All Implemented Interfaces:
LoadBalancerFactory<ResolvedAddress,,C> ExecutionStrategyInfluencer<ExecutionStrategy>
@Deprecated
public final class RoundRobinLoadBalancerFactory<ResolvedAddress,C extends LoadBalancedConnection>
extends Object
implements LoadBalancerFactory<ResolvedAddress,C>
Deprecated.
LoadBalancerFactory that creates LoadBalancer instances which use a round-robin strategy
for selecting connections from a pool of addresses.
For more information, see javadoc for RoundRobinLoadBalancerBuilder.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classDeprecated.rely on theLoadBalancers.builder(String)instead. -
Method Summary
Modifier and TypeMethodDescriptionnewLoadBalancer(Publisher<? extends Collection<? extends ServiceDiscovererEvent<ResolvedAddress>>> eventPublisher, ConnectionFactory<ResolvedAddress, C> connectionFactory, String targetResource) Deprecated.Create a newLoadBalancer.<T extends C>
LoadBalancer<T>newLoadBalancer(String targetResource, Publisher<? extends Collection<? extends ServiceDiscovererEvent<ResolvedAddress>>> eventPublisher, ConnectionFactory<ResolvedAddress, T> connectionFactory) Deprecated.Deprecated.Return anExecutionStrategythat describes the offloads required by the influencer.toString()Deprecated.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.servicetalk.client.api.LoadBalancerFactory
newLoadBalancer
-
Method Details
-
newLoadBalancer
@Deprecated public <T extends C> LoadBalancer<T> newLoadBalancer(String targetResource, Publisher<? extends Collection<? extends ServiceDiscovererEvent<ResolvedAddress>>> eventPublisher, ConnectionFactory<ResolvedAddress, T> connectionFactory) Deprecated.Description copied from interface:LoadBalancerFactoryCreate a newLoadBalancer.- Specified by:
newLoadBalancerin interfaceLoadBalancerFactory<ResolvedAddress,C extends LoadBalancedConnection> - Type Parameters:
T- Type of connections created by the passedConnectionFactory.- Parameters:
targetResource- AStringrepresentation of the target resource for which the created instance will perform load balancing. Bear in mind, load balancing is performed over the a collection of hosts provided via theeventPublisherwhich may not correspond directly to a single unresolved address, but potentially a merged collection.eventPublisher- A stream ofCollection<ServiceDiscovererEvent> which theLoadBalancercan use to connect to physical hosts. Typically generated fromServiceDiscoverer.connectionFactory-ConnectionFactorythat the returnedLoadBalancerwill use to generate new connections. ReturnedLoadBalancerwill own the responsibility for thisConnectionFactoryand hence will callAsyncCloseable.closeAsync()whenAsyncCloseable.closeAsync()is called.- Returns:
- a new
LoadBalancer.
-
newLoadBalancer
public LoadBalancer<C> newLoadBalancer(Publisher<? extends Collection<? extends ServiceDiscovererEvent<ResolvedAddress>>> eventPublisher, ConnectionFactory<ResolvedAddress, C> connectionFactory, String targetResource) Deprecated.Description copied from interface:LoadBalancerFactoryCreate a newLoadBalancer.- Specified by:
newLoadBalancerin interfaceLoadBalancerFactory<ResolvedAddress,C extends LoadBalancedConnection> - Parameters:
eventPublisher- A stream ofCollection<ServiceDiscovererEvent> which theLoadBalancercan use to connect to physical hosts. Typically generated fromServiceDiscoverer.connectionFactory-ConnectionFactorythat the returnedLoadBalancerwill use to generate new connections. ReturnedLoadBalancerwill own the responsibility for thisConnectionFactoryand hence will callAsyncCloseable.closeAsync()whenAsyncCloseable.closeAsync()is called.targetResource- AStringrepresentation of the target resource for which the created instance will perform load balancing. Bear in mind, load balancing is performed over the collection of hosts provided via theeventPublisherwhich may not correspond directly to a single unresolved address, but potentially a merged collection.- Returns:
- a new
LoadBalancer.
-
requiredOffloads
Deprecated.Description copied from interface:ExecutionStrategyInfluencerReturn anExecutionStrategythat describes the offloads required by the influencer.- Specified by:
requiredOffloadsin interfaceExecutionStrategyInfluencer<ResolvedAddress>- Specified by:
requiredOffloadsin interfaceLoadBalancerFactory<ResolvedAddress,C extends LoadBalancedConnection> - Returns:
- the
ExecutionStrategyrequired by the influencer.
-
toString
Deprecated.
-
LoadBalancersto createLoadBalancerFactoryinstances.RoundRobinLoadBalancerBuilder.