Package com.yahoo.vespa.filedistribution
Class FileDistributionConnectionPool
java.lang.Object
com.yahoo.vespa.config.JRTConnectionPool
com.yahoo.vespa.filedistribution.FileDistributionConnectionPool
- All Implemented Interfaces:
com.yahoo.vespa.config.ConnectionPool
,AutoCloseable
public class FileDistributionConnectionPool
extends com.yahoo.vespa.config.JRTConnectionPool
A pool of JRT connections to a set of file distribution source (one or more config servers).
Used by file distribution clients, where the source that can serve a file reference might be
different for each file reference (unlike config requests, where all requests should be served by the same source).
A new connection is chosen randomly when calling {#link
switchConnection(Connection failingConnection)
}.
Unlike JRTConnectionPool there is no state that holds the 'current' connection, a new connection is picked
randomly if getCurrent()
is called.- Author:
- hmusum
-
Constructor Summary
ConstructorDescriptionFileDistributionConnectionPool
(com.yahoo.config.subscription.ConfigSourceSet sourceSet, com.yahoo.jrt.Supervisor supervisor) -
Method Summary
Modifier and TypeMethodDescriptioncom.yahoo.vespa.config.JRTConnection
com.yahoo.vespa.config.JRTConnection
switchConnection
(com.yahoo.vespa.config.Connection failingConnection) Methods inherited from class com.yahoo.vespa.config.JRTConnectionPool
addSources, close, getSize, getSources, initialize, pickNewConnectionRandomly, toString, updateSources, updateSources
-
Constructor Details
-
FileDistributionConnectionPool
public FileDistributionConnectionPool(com.yahoo.config.subscription.ConfigSourceSet sourceSet, com.yahoo.jrt.Supervisor supervisor)
-
-
Method Details
-
getCurrent
public com.yahoo.vespa.config.JRTConnection getCurrent()- Specified by:
getCurrent
in interfacecom.yahoo.vespa.config.ConnectionPool
- Overrides:
getCurrent
in classcom.yahoo.vespa.config.JRTConnectionPool
-
switchConnection
public com.yahoo.vespa.config.JRTConnection switchConnection(com.yahoo.vespa.config.Connection failingConnection) - Specified by:
switchConnection
in interfacecom.yahoo.vespa.config.ConnectionPool
- Overrides:
switchConnection
in classcom.yahoo.vespa.config.JRTConnectionPool
-