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
Modifier and TypeClassDescriptionstatic final class
Deprecated.this class will be made package-private in the future, rely on theRoundRobinLoadBalancerBuilder
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 anExecutionStrategy
that describes the offloads required by the influencer.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:LoadBalancerFactory
Create a newLoadBalancer
.- Specified by:
newLoadBalancer
in interfaceLoadBalancerFactory<ResolvedAddress,
C extends LoadBalancedConnection> - Type Parameters:
T
- Type of connections created by the passedConnectionFactory
.- Parameters:
targetResource
- AString
representation 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 theeventPublisher
which may not correspond directly to a single unresolved address, but potentially a merged collection.eventPublisher
- A stream ofCollection
<ServiceDiscovererEvent
> which theLoadBalancer
can use to connect to physical hosts. Typically generated fromServiceDiscoverer
.connectionFactory
-ConnectionFactory
that the returnedLoadBalancer
will use to generate new connections. ReturnedLoadBalancer
will own the responsibility for thisConnectionFactory
and 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:LoadBalancerFactory
Create a newLoadBalancer
.- Specified by:
newLoadBalancer
in interfaceLoadBalancerFactory<ResolvedAddress,
C extends LoadBalancedConnection> - Parameters:
eventPublisher
- A stream ofCollection
<ServiceDiscovererEvent
> which theLoadBalancer
can use to connect to physical hosts. Typically generated fromServiceDiscoverer
.connectionFactory
-ConnectionFactory
that the returnedLoadBalancer
will use to generate new connections. ReturnedLoadBalancer
will own the responsibility for thisConnectionFactory
and hence will callAsyncCloseable.closeAsync()
whenAsyncCloseable.closeAsync()
is called.targetResource
- AString
representation 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 theeventPublisher
which may not correspond directly to a single unresolved address, but potentially a merged collection.- Returns:
- a new
LoadBalancer
.
-
requiredOffloads
Deprecated.Description copied from interface:ExecutionStrategyInfluencer
Return anExecutionStrategy
that describes the offloads required by the influencer.- Specified by:
requiredOffloads
in interfaceExecutionStrategyInfluencer<ResolvedAddress>
- Specified by:
requiredOffloads
in interfaceLoadBalancerFactory<ResolvedAddress,
C extends LoadBalancedConnection> - Returns:
- the
ExecutionStrategy
required by the influencer.
-
RoundRobinLoadBalancers
to createRoundRobinLoadBalancerBuilder
.