Package io.servicetalk.http.netty
Class DefaultHttpLoadBalancerFactory<ResolvedAddress>
java.lang.Object
io.servicetalk.http.netty.DefaultHttpLoadBalancerFactory<ResolvedAddress>
- Type Parameters:
ResolvedAddress- The type of address after resolution.
- All Implemented Interfaces:
LoadBalancerFactory<ResolvedAddress,,FilterableStreamingHttpLoadBalancedConnection> HttpLoadBalancerFactory<ResolvedAddress>,ExecutionStrategyInfluencer<ExecutionStrategy>
@Deprecated
public final class DefaultHttpLoadBalancerFactory<ResolvedAddress>
extends Object
implements HttpLoadBalancerFactory<ResolvedAddress>
Deprecated.
Default implementation of
HttpLoadBalancerFactory.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classDeprecated.A builder for creating instances ofDefaultHttpLoadBalancerFactory. -
Method Summary
Modifier and TypeMethodDescriptionnewLoadBalancer(Publisher<? extends Collection<? extends ServiceDiscovererEvent<ResolvedAddress>>> eventPublisher, ConnectionFactory<ResolvedAddress, FilterableStreamingHttpLoadBalancedConnection> connectionFactory, String targetResource) Deprecated.Create a newLoadBalancer.<T extends FilterableStreamingHttpLoadBalancedConnection>
LoadBalancer<T>newLoadBalancer(String targetResource, Publisher<? extends Collection<? extends ServiceDiscovererEvent<ResolvedAddress>>> eventPublisher, ConnectionFactory<ResolvedAddress, T> connectionFactory) Deprecated.Create a newLoadBalancer.Deprecated.Return anExecutionStrategythat describes the offloads required by the influencer.Deprecated.Converts the passedFilterableStreamingHttpConnectionto aFilterableStreamingHttpLoadBalancedConnection.toLoadBalancedConnection(FilterableStreamingHttpConnection connection, ReservableRequestConcurrencyController concurrencyController, ContextMap context) Deprecated.Converts the passedFilterableStreamingHttpConnectionto aFilterableStreamingHttpLoadBalancedConnection.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
public <T extends FilterableStreamingHttpLoadBalancedConnection> 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,FilterableStreamingHttpLoadBalancedConnection> - 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<FilterableStreamingHttpLoadBalancedConnection> newLoadBalancer(Publisher<? extends Collection<? extends ServiceDiscovererEvent<ResolvedAddress>>> eventPublisher, ConnectionFactory<ResolvedAddress, FilterableStreamingHttpLoadBalancedConnection> connectionFactory, String targetResource) Deprecated.Description copied from interface:LoadBalancerFactoryCreate a newLoadBalancer.- Specified by:
newLoadBalancerin interfaceLoadBalancerFactory<ResolvedAddress,FilterableStreamingHttpLoadBalancedConnection> - 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.
-
toLoadBalancedConnection
public FilterableStreamingHttpLoadBalancedConnection toLoadBalancedConnection(FilterableStreamingHttpConnection connection) Deprecated.Description copied from interface:HttpLoadBalancerFactoryConverts the passedFilterableStreamingHttpConnectionto aFilterableStreamingHttpLoadBalancedConnection.- Specified by:
toLoadBalancedConnectionin interfaceHttpLoadBalancerFactory<ResolvedAddress>- Parameters:
connection-FilterableStreamingHttpConnectionto convert- Returns:
FilterableStreamingHttpLoadBalancedConnectionfor the passedFilterableStreamingHttpConnection
-
toLoadBalancedConnection
public FilterableStreamingHttpLoadBalancedConnection toLoadBalancedConnection(FilterableStreamingHttpConnection connection, ReservableRequestConcurrencyController concurrencyController, @Nullable ContextMap context) Deprecated.Description copied from interface:HttpLoadBalancerFactoryConverts the passedFilterableStreamingHttpConnectionto aFilterableStreamingHttpLoadBalancedConnection.- Specified by:
toLoadBalancedConnectionin interfaceHttpLoadBalancerFactory<ResolvedAddress>- Parameters:
connection-FilterableStreamingHttpConnectionto convertconcurrencyController-ReservableRequestConcurrencyControllerto control access to the connectioncontext- Acontextof the caller (e.g. request/LB context) ornullif no context- Returns:
FilterableStreamingHttpLoadBalancedConnectionfor the passedFilterableStreamingHttpConnection.
-
requiredOffloads
Deprecated.Description copied from interface:ExecutionStrategyInfluencerReturn anExecutionStrategythat describes the offloads required by the influencer.- Specified by:
requiredOffloadsin interfaceExecutionStrategyInfluencer<ResolvedAddress>- Specified by:
requiredOffloadsin interfaceHttpLoadBalancerFactory<ResolvedAddress>- Specified by:
requiredOffloadsin interfaceLoadBalancerFactory<ResolvedAddress,FilterableStreamingHttpLoadBalancedConnection> - Returns:
- the
ExecutionStrategyrequired by the influencer.
-
toString
Deprecated.
-
DefaultHttpLoadBalancerFactoryinstead.