summaryrefslogtreecommitdiffstats
path: root/node-admin
diff options
context:
space:
mode:
authorValerij Fredriksen <valerijf@verizonmedia.com>2019-06-21 10:47:34 +0200
committerValerij Fredriksen <valerijf@verizonmedia.com>2019-06-21 10:47:34 +0200
commit57a067797e293723fd93f486e68ec57b07d0a20e (patch)
tree2f9b240fc19c6a5c53ee42edb5b38ec0cbb8cdc1 /node-admin
parent612d02e428be57f8e91cf4b3aec5c7560a389266 (diff)
HttpConnectionException -> ConnectionException
Diffstat (limited to 'node-admin')
-rw-r--r--node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/ConfigServerApiImpl.java4
-rw-r--r--node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/ConnectionException.java (renamed from node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/HttpConnectionException.java)8
-rw-r--r--node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/orchestrator/OrchestratorImpl.java8
-rw-r--r--node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/state/StateImpl.java4
-rw-r--r--node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/configserver/state/StateImplTest.java4
5 files changed, 14 insertions, 14 deletions
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/ConfigServerApiImpl.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/ConfigServerApiImpl.java
index 3a0fffcd534..59873d7956e 100644
--- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/ConfigServerApiImpl.java
+++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/ConfigServerApiImpl.java
@@ -116,7 +116,7 @@ public class ConfigServerApiImpl implements ConfigServerApi {
if (configServers.size() == 1) break;
// Failure to communicate with a config server is not abnormal during upgrades
- if (HttpConnectionException.isKnownConnectionException(e)) {
+ if (ConnectionException.isKnownConnectionException(e)) {
logger.info("Failed to connect to " + configServer + " (upgrading?), will try next: " + e.getMessage());
} else {
logger.warning("Failed to communicate with " + configServer + ", will try next: " + e.getMessage());
@@ -127,7 +127,7 @@ public class ConfigServerApiImpl implements ConfigServerApi {
String prefix = configServers.size() == 1 ?
"Request against " + configServers.get(0) + " failed: " :
"All requests against the config servers (" + configServers + ") failed, last as follows: ";
- throw HttpConnectionException.handleException(prefix, lastException);
+ throw ConnectionException.handleException(prefix, lastException);
}
@Override
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/HttpConnectionException.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/ConnectionException.java
index cb4af3b4edc..7e860bfb66b 100644
--- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/HttpConnectionException.java
+++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/ConnectionException.java
@@ -12,19 +12,19 @@ import java.net.SocketTimeoutException;
* @author freva
*/
@SuppressWarnings("serial")
-public class HttpConnectionException extends ConvergenceException {
+public class ConnectionException extends ConvergenceException {
- private HttpConnectionException(String message) {
+ private ConnectionException(String message) {
super(message);
}
/**
- * Returns {@link HttpConnectionException} if the given Throwable is of a known and well understood error or
+ * Returns {@link ConnectionException} if the given Throwable is of a known and well understood error or
* a RuntimeException with the given exception as cause otherwise.
*/
public static RuntimeException handleException(String prefix, Throwable t) {
if (isKnownConnectionException(t))
- return new HttpConnectionException(prefix + t.getMessage());
+ return new ConnectionException(prefix + t.getMessage());
return new RuntimeException(prefix, t);
}
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/orchestrator/OrchestratorImpl.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/orchestrator/OrchestratorImpl.java
index ea0e4271c16..353abd64778 100644
--- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/orchestrator/OrchestratorImpl.java
+++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/orchestrator/OrchestratorImpl.java
@@ -2,7 +2,7 @@
package com.yahoo.vespa.hosted.node.admin.configserver.orchestrator;
import com.yahoo.vespa.hosted.node.admin.configserver.ConfigServerApi;
-import com.yahoo.vespa.hosted.node.admin.configserver.HttpConnectionException;
+import com.yahoo.vespa.hosted.node.admin.configserver.ConnectionException;
import com.yahoo.vespa.hosted.node.admin.configserver.HttpException;
import com.yahoo.vespa.hosted.node.admin.nodeadmin.ConvergenceException;
import com.yahoo.vespa.orchestrator.restapi.HostApi;
@@ -43,7 +43,7 @@ public class OrchestratorImpl implements Orchestrator {
throw new OrchestratorNotFoundException("Failed to suspend " + hostName + ", host not found");
} catch (HttpException e) {
throw new OrchestratorException("Failed to suspend " + hostName + ": " + e.toString());
- } catch (HttpConnectionException e) {
+ } catch (ConnectionException e) {
throw new ConvergenceException("Failed to suspend " + hostName + ": " + e.getMessage());
} catch (RuntimeException e) {
throw new RuntimeException("Got error on suspend", e);
@@ -64,7 +64,7 @@ public class OrchestratorImpl implements Orchestrator {
batchOperationResult = configServerApi.put(url, Optional.empty(), BatchOperationResult.class);
} catch (HttpException e) {
throw new OrchestratorException("Failed to batch suspend for " + parentHostName + ": " + e.toString());
- } catch (HttpConnectionException e) {
+ } catch (ConnectionException e) {
throw new ConvergenceException("Failed to batch suspend for " + parentHostName + ": " + e.getMessage());
} catch (RuntimeException e) {
throw new RuntimeException("Got error on batch suspend for " + parentHostName + ", with nodes " + hostNames, e);
@@ -85,7 +85,7 @@ public class OrchestratorImpl implements Orchestrator {
throw new OrchestratorNotFoundException("Failed to resume " + hostName + ", host not found");
} catch (HttpException e) {
throw new OrchestratorException("Failed to resume " + hostName + ": " + e.toString());
- } catch (HttpConnectionException e) {
+ } catch (ConnectionException e) {
throw new ConvergenceException("Failed to resume " + hostName + ": " + e.getMessage());
} catch (RuntimeException e) {
throw new RuntimeException("Got error on resume", e);
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/state/StateImpl.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/state/StateImpl.java
index 2b8db6fea10..e99a107cfe1 100644
--- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/state/StateImpl.java
+++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/state/StateImpl.java
@@ -2,7 +2,7 @@
package com.yahoo.vespa.hosted.node.admin.configserver.state;
import com.yahoo.vespa.hosted.node.admin.configserver.ConfigServerApi;
-import com.yahoo.vespa.hosted.node.admin.configserver.HttpConnectionException;
+import com.yahoo.vespa.hosted.node.admin.configserver.ConnectionException;
import com.yahoo.vespa.hosted.node.admin.configserver.HttpException;
import com.yahoo.vespa.hosted.node.admin.configserver.state.bindings.HealthResponse;
@@ -21,7 +21,7 @@ public class StateImpl implements State {
try {
HealthResponse response = configServerApi.get("/state/v1/health", HealthResponse.class);
return HealthCode.fromString(response.status.code);
- } catch (HttpConnectionException | HttpException e) {
+ } catch (ConnectionException | HttpException e) {
return HealthCode.DOWN;
}
}
diff --git a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/configserver/state/StateImplTest.java b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/configserver/state/StateImplTest.java
index e58e9a9a814..a3256b6955b 100644
--- a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/configserver/state/StateImplTest.java
+++ b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/configserver/state/StateImplTest.java
@@ -2,7 +2,7 @@
package com.yahoo.vespa.hosted.node.admin.configserver.state;
import com.yahoo.vespa.hosted.node.admin.configserver.ConfigServerApi;
-import com.yahoo.vespa.hosted.node.admin.configserver.HttpConnectionException;
+import com.yahoo.vespa.hosted.node.admin.configserver.ConnectionException;
import com.yahoo.vespa.hosted.node.admin.configserver.state.bindings.HealthResponse;
import org.junit.Test;
@@ -30,7 +30,7 @@ public class StateImplTest {
@Test
public void connectException() {
RuntimeException exception =
- HttpConnectionException.handleException("Error: ", new ConnectException("connection refused"));
+ ConnectionException.handleException("Error: ", new ConnectException("connection refused"));
when(api.get(any(), any())).thenThrow(exception);
HealthCode code = state.getHealth();