summaryrefslogtreecommitdiffstats
path: root/orchestrator/src/main
diff options
context:
space:
mode:
authorHåkon Hallingstad <hakon@oath.com>2018-10-26 09:44:35 +0200
committerHåkon Hallingstad <hakon@oath.com>2018-10-26 09:44:35 +0200
commit67878e49f9442d43d42d35f0ebbb57735ad2edbf (patch)
tree5becab9bd4740bf63256d57bf9bb6370b6863140 /orchestrator/src/main
parent0ccd403b2eed0476a17548a55107bb036567c3f0 (diff)
Fixes after review round
Diffstat (limited to 'orchestrator/src/main')
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/controller/ClusterControllerClientImpl.java4
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/controller/ClusterControllerClientTimeouts.java10
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/StatusService.java2
3 files changed, 8 insertions, 8 deletions
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/controller/ClusterControllerClientImpl.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/controller/ClusterControllerClientImpl.java
index 50782ea081f..d7e63ccfc76 100644
--- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/controller/ClusterControllerClientImpl.java
+++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/controller/ClusterControllerClientImpl.java
@@ -42,7 +42,7 @@ public class ClusterControllerClientImpl implements ClusterControllerClient{
return clusterControllerApi.apply(api -> api.setNodeState(
clusterName,
storageNodeIndex,
- timeouts.getServerTimeout().toMillis() / 1000.0f,
+ timeouts.getServerTimeoutOrThrow().toMillis() / 1000.0f,
stateRequest),
timeouts);
} catch (IOException | UncheckedTimeoutException e) {
@@ -72,7 +72,7 @@ public class ClusterControllerClientImpl implements ClusterControllerClient{
try {
return clusterControllerApi.apply(api -> api.setClusterState(
clusterName,
- timeouts.getServerTimeout().toMillis() / 1000.0f,
+ timeouts.getServerTimeoutOrThrow().toMillis() / 1000.0f,
stateRequest),
timeouts);
} catch (IOException | UncheckedTimeoutException e) {
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/controller/ClusterControllerClientTimeouts.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/controller/ClusterControllerClientTimeouts.java
index 6c08ae53e70..5b0685e88a0 100644
--- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/controller/ClusterControllerClientTimeouts.java
+++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/controller/ClusterControllerClientTimeouts.java
@@ -76,12 +76,12 @@ public class ClusterControllerClientTimeouts implements JaxRsTimeouts {
}
@Override
- public Duration getConnectTimeout() {
+ public Duration getConnectTimeoutOrThrow() {
return CONNECT_TIMEOUT;
}
@Override
- public Duration getReadTimeout() {
+ public Duration getReadTimeoutOrThrow() {
Duration timeLeft = timeBudget.timeLeft().get();
if (timeLeft.toMillis() <= 0) {
throw new UncheckedTimeoutException("Exceeded the timeout " + timeBudget.originalTimeout().get() +
@@ -89,7 +89,7 @@ public class ClusterControllerClientTimeouts implements JaxRsTimeouts {
}
Duration clientTimeout = min(timeLeft, maxClientTimeout);
- verifyPositive(timeLeft, maxClientTimeout);
+ verifyPositive(timeLeft, clientTimeout);
// clientTimeout = overheadPerCall + connectTimeout + readTimeout
Duration readTimeout = clientTimeout.minus(IN_PROCESS_OVERHEAD_PER_CALL).minus(CONNECT_TIMEOUT);
@@ -98,9 +98,9 @@ public class ClusterControllerClientTimeouts implements JaxRsTimeouts {
return readTimeout;
}
- public Duration getServerTimeout() {
+ public Duration getServerTimeoutOrThrow() {
// readTimeout = networkOverhead + serverTimeout
- Duration serverTimeout = getReadTimeout().minus(NETWORK_OVERHEAD_PER_CALL);
+ Duration serverTimeout = getReadTimeoutOrThrow().minus(NETWORK_OVERHEAD_PER_CALL);
if (serverTimeout.toMillis() < MIN_SERVER_TIMEOUT.toMillis()) {
throw new UncheckedTimeoutException("Server would be given too little time to complete: " +
serverTimeout + ". Original timeout was " + timeBudget.originalTimeout().get());
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/StatusService.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/StatusService.java
index 768e5290412..76adef72b2b 100644
--- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/StatusService.java
+++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/StatusService.java
@@ -55,7 +55,7 @@ public interface StatusService {
*/
MutableStatusRegistry lockApplicationInstance_forCurrentThreadOnly(
ApplicationInstanceReference applicationInstanceReference,
- Duration timeoutSeconds);
+ Duration timeout);
/**
* Returns all application instances that are allowed to be down. The intention is to use this