diff options
Diffstat (limited to 'config/src/main/java/com')
4 files changed, 5 insertions, 21 deletions
diff --git a/config/src/main/java/com/yahoo/config/subscription/impl/JRTConfigRequester.java b/config/src/main/java/com/yahoo/config/subscription/impl/JRTConfigRequester.java index 7713d509f69..ce24d784776 100644 --- a/config/src/main/java/com/yahoo/config/subscription/impl/JRTConfigRequester.java +++ b/config/src/main/java/com/yahoo/config/subscription/impl/JRTConfigRequester.java @@ -165,7 +165,7 @@ public class JRTConfigRequester implements RequestWaiter { // The subscription object has an "old" config, which is all we have to offer back now log.log(INFO, "Failure of config subscription tp " + connection.getAddress() + ", clients will keep existing config until resolved: " + sub); - connectionPool.setError(connection, jrtReq.errorCode()); + connectionPool.switchConnection(connection); failures++; long delay = calculateFailedRequestDelay(failures, timingValues); // The logging depends on whether we are configured or not. diff --git a/config/src/main/java/com/yahoo/config/subscription/impl/MockConnection.java b/config/src/main/java/com/yahoo/config/subscription/impl/MockConnection.java index e9e7f3e7bce..c27e4cb2bc8 100644 --- a/config/src/main/java/com/yahoo/config/subscription/impl/MockConnection.java +++ b/config/src/main/java/com/yahoo/config/subscription/impl/MockConnection.java @@ -1,4 +1,4 @@ -// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.config.subscription.impl; import com.yahoo.jrt.Request; @@ -62,9 +62,6 @@ public class MockConnection implements ConnectionPool, Connection { public void close() {} @Override - public void setError(Connection connection, int errorCode) { } - - @Override public Connection getCurrent() { return this; } diff --git a/config/src/main/java/com/yahoo/vespa/config/ConnectionPool.java b/config/src/main/java/com/yahoo/vespa/config/ConnectionPool.java index 93135fc4661..1ee44bfee87 100644 --- a/config/src/main/java/com/yahoo/vespa/config/ConnectionPool.java +++ b/config/src/main/java/com/yahoo/vespa/config/ConnectionPool.java @@ -1,4 +1,4 @@ -// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.config; import com.yahoo.jrt.Supervisor; @@ -10,18 +10,11 @@ public interface ConnectionPool extends AutoCloseable { void close(); - /** - * Sets the supplied Connection to have an error, implementations are expected to call - * {@link #switchConnection(Connection)} after setting state for the supplied Connection. - * - */ - void setError(Connection connection, int i); - Connection getCurrent(); /** * Switches to another (healthy, if one exists) Connection instance. - * Returns the resulting Connection. See also {@link #setError(Connection, int)} + * Returns the resulting Connection. * * @return a Connection */ 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 78580328bf9..f4876826492 100644 --- a/config/src/main/java/com/yahoo/vespa/config/JRTConnectionPool.java +++ b/config/src/main/java/com/yahoo/vespa/config/JRTConnectionPool.java @@ -1,4 +1,4 @@ -// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.config; import com.yahoo.config.subscription.ConfigSourceSet; @@ -18,7 +18,6 @@ import java.util.logging.Logger; * The current connection is chosen randomly when calling {#link {@link #switchConnection()}} * (it will continue to use the same connection if there is only one source). * The current connection is available with {@link #getCurrent()}. - * When calling {@link #setError(Connection, int)}, {@link #switchConnection()} will always be called. * * @author Gunnar Gauslaa Bergem * @author hmusum @@ -115,11 +114,6 @@ public class JRTConnectionPool implements ConnectionPool { return sourceSet; } - @Override - public void setError(Connection connection, int errorCode) { - switchConnection(connection); - } - public JRTConnectionPool updateSources(List<String> addresses) { ConfigSourceSet newSources = new ConfigSourceSet(addresses); return updateSources(newSources); |