diff options
author | Harald Musum <musum@yahooinc.com> | 2021-11-16 08:20:57 +0100 |
---|---|---|
committer | Harald Musum <musum@yahooinc.com> | 2021-11-16 08:20:57 +0100 |
commit | b6fea176befc91d85d708a26a5ab320ff8db52b0 (patch) | |
tree | 4ff8f58cfc6a1babfcfafba7e8718e938cba3bd0 /config | |
parent | 7e39d82e3b71d1957fb40edb6958dee4f2751d24 (diff) |
Add FileDistributionConnectionPool
FileDistributionConnectionPool is better suited for connections getting
files, since each file migh be available on different connections and
switching connection for all file downloads if one fails does not make
sense, instead one should switch per file download if necessary.
Diffstat (limited to 'config')
-rw-r--r-- | config/src/main/java/com/yahoo/vespa/config/JRTConnectionPool.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/config/src/main/java/com/yahoo/vespa/config/JRTConnectionPool.java b/config/src/main/java/com/yahoo/vespa/config/JRTConnectionPool.java index 14385cbc90e..f6708a1432c 100644 --- a/config/src/main/java/com/yahoo/vespa/config/JRTConnectionPool.java +++ b/config/src/main/java/com/yahoo/vespa/config/JRTConnectionPool.java @@ -95,11 +95,11 @@ public class JRTConnectionPool implements ConnectionPool { return pickNewConnectionRandomly(getSources()); } - private JRTConnection pickNewConnectionRandomly(List<JRTConnection> sources) { + protected JRTConnection pickNewConnectionRandomly(List<JRTConnection> sources) { return sources.get(ThreadLocalRandom.current().nextInt(0, sources.size())); } - List<JRTConnection> getSources() { + protected List<JRTConnection> getSources() { List<JRTConnection> ret; synchronized (connections) { ret = new ArrayList<>(connections.values()); |