summaryrefslogtreecommitdiffstats
path: root/orchestrator
diff options
context:
space:
mode:
authorHarald Musum <musum@yahooinc.com>2023-03-24 09:53:01 +0100
committerHarald Musum <musum@yahooinc.com>2023-03-24 09:53:01 +0100
commit7202095010602814e5aa8b9ae1a17f3832ce67e7 (patch)
treec28441eea2a082c50bd2b87bbcb07560967acc04 /orchestrator
parentd3aded0218514e6a45cd2aee4548e705095c0e90 (diff)
Cosmetic changes
Diffstat (limited to 'orchestrator')
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/OrchestratorImpl.java6
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/VespaModelUtil.java3
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/ConcurrentSuspensionLimitForCluster.java2
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/ApplicationSuspensionRequestHandler.java2
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/ApplicationInstanceStatus.java2
-rw-r--r--orchestrator/src/test/java/com/yahoo/vespa/orchestrator/model/ApplicationApiImplTest.java18
6 files changed, 15 insertions, 18 deletions
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/OrchestratorImpl.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/OrchestratorImpl.java
index 51f6379ae95..49fab7522ba 100644
--- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/OrchestratorImpl.java
+++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/OrchestratorImpl.java
@@ -183,7 +183,7 @@ public class OrchestratorImpl implements Orchestrator {
* and may therefore mistakenly report services as up, even if they still haven't initialized and
* are not yet ready for serving. Erroneously reporting both host and services as up causes a race
* where services on other hosts may be stopped prematurely. A delay here ensures that service
- * monitoring will have had time to catch up. Since we don't want do the delay with the lock held,
+ * monitoring will have had time to catch up. Since we don't want to do the delay with the lock held,
* and the host status service's locking functionality does not support something like condition
* variables or Object.wait(), we break out here, releasing the lock before delaying.
*
@@ -330,13 +330,13 @@ public class OrchestratorImpl implements Orchestrator {
* - Docker host 1 asks to suspend A1 and B1, while
* - Docker host 2 asks to suspend B2 and A2.
*
- * The Orchestrator may allow suspend of A1 and B2, before requesting the suspension of B1 and A2.
+ * The Orchestrator may allow suspension of A1 and B2, before requesting the suspension of B1 and A2.
* None of these can be suspended (assuming max 1 suspended content node per content cluster),
* and so both requests for suspension will fail.
*
* Note that it's not a deadlock - both client will fail immediately and resume both A1 and B2 before
* responding to the client, and if host 1 asks later w/o host 2 asking at the same time,
- * it will be given permission to suspend. However if both hosts were to request in lock-step,
+ * it will be given permission to suspend. However, if both hosts were to request in lock-step,
* there would be starvation. And in general, it would fail requests for suspension more
* than necessary.
*
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/VespaModelUtil.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/VespaModelUtil.java
index 092ed531c92..7793037be31 100644
--- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/VespaModelUtil.java
+++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/VespaModelUtil.java
@@ -9,14 +9,12 @@ import com.yahoo.vespa.applicationmodel.HostName;
import com.yahoo.vespa.applicationmodel.ServiceCluster;
import com.yahoo.vespa.applicationmodel.ServiceInstance;
import com.yahoo.vespa.applicationmodel.ServiceType;
-
import java.util.Collection;
import java.util.Comparator;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
-import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
@@ -30,7 +28,6 @@ import static com.yahoo.collections.CollectionUtil.first;
* @author hakonhall
*/
public class VespaModelUtil {
- private static final Logger log = Logger.getLogger(VespaModelUtil.class.getName());
public static final ApplicationId TENANT_HOST_APPLICATION_ID =
ApplicationId.from("hosted-vespa", "tenant-host", "default");
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/ConcurrentSuspensionLimitForCluster.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/ConcurrentSuspensionLimitForCluster.java
index 66c9a853259..3ad20f1a37e 100644
--- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/ConcurrentSuspensionLimitForCluster.java
+++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/ConcurrentSuspensionLimitForCluster.java
@@ -12,7 +12,7 @@ public enum ConcurrentSuspensionLimitForCluster {
FIFTY_PERCENT(50),
ALL_NODES(100);
- int percentage;
+ final int percentage;
ConcurrentSuspensionLimitForCluster(int percentage) {
this.percentage = percentage;
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/ApplicationSuspensionRequestHandler.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/ApplicationSuspensionRequestHandler.java
index a8a8700d631..5dfb1df87a5 100644
--- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/ApplicationSuspensionRequestHandler.java
+++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/ApplicationSuspensionRequestHandler.java
@@ -49,7 +49,7 @@ public class ApplicationSuspensionRequestHandler extends RestApiRequestHandler<A
}
/**
- * Lists all applications that is currently suspended.
+ * Lists all applications that are currently suspended.
*
* HTTP Behavior:
* Always 200
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/ApplicationInstanceStatus.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/ApplicationInstanceStatus.java
index 6a8fb956e58..d84e82a47b0 100644
--- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/ApplicationInstanceStatus.java
+++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/ApplicationInstanceStatus.java
@@ -7,7 +7,7 @@ package com.yahoo.vespa.orchestrator.status;
* The naming and conventions follows the same pattern as with the HostStatus and is:
*
* When the node is suspended - the orchestration state is 'allowed to be down'. The application
- * is not necessarily suspended pr. se but it is allowed to start suspending - or is back up from suspension
+ * is not necessarily suspended pr. se, but it is allowed to start suspending - or is back up from suspension
* but the flag is not revoked yet.
*
* @see HostStatus
diff --git a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/model/ApplicationApiImplTest.java b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/model/ApplicationApiImplTest.java
index b48fb75e781..8239c962ad7 100644
--- a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/model/ApplicationApiImplTest.java
+++ b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/model/ApplicationApiImplTest.java
@@ -175,18 +175,18 @@ public class ApplicationApiImplTest {
private void verifyNoRemarksConditionWith(HostStatus hostStatus, ServiceStatus serviceStatus, boolean expectUp) {
HostName hostName1 = new HostName("host1");
ApplicationInstance applicationInstance =
- modelUtils.createApplicationInstance(Arrays.asList(
+ modelUtils.createApplicationInstance(List.of(
modelUtils.createServiceCluster(
"cluster-1",
ServiceType.STORAGE,
- Arrays.asList(modelUtils.createServiceInstance("config-id-1", hostName1, serviceStatus))
+ List.of(modelUtils.createServiceInstance("config-id-1", hostName1, serviceStatus))
)
));
modelUtils.createNode("host1", hostStatus);
try (var scopedApi = modelUtils.createScopedApplicationApi(applicationInstance, hostName1)) {
- List<HostName> upStorageNodes = expectUp ? Arrays.asList(hostName1) : new ArrayList<>();
+ List<HostName> upStorageNodes = expectUp ? List.of(hostName1) : new ArrayList<>();
List<HostName> actualStorageNodes = scopedApi.applicationApi()
.getNoRemarksStorageNodesInGroupInClusterOrder()
@@ -229,20 +229,20 @@ public class ApplicationApiImplTest {
verifyNodesInGroupWithoutRemarks(
modelUtils.createScopedApplicationApi(applicationInstance, hostName1),
- Arrays.asList(hostName1),
- Arrays.asList());
+ List.of(hostName1),
+ List.of());
verifyNodesInGroupWithoutRemarks(
modelUtils.createScopedApplicationApi(applicationInstance, hostName1, hostName2),
Arrays.asList(hostName1, hostName2),
- Arrays.asList());
+ List.of());
verifyNodesInGroupWithoutRemarks(
modelUtils.createScopedApplicationApi(applicationInstance, hostName1, hostName2, hostName3),
Arrays.asList(hostName1, hostName2),
- Arrays.asList(hostName3));
+ List.of(hostName3));
verifyNodesInGroupWithoutRemarks(
modelUtils.createScopedApplicationApi(applicationInstance, hostName3),
- Arrays.asList(),
- Arrays.asList(hostName3));
+ List.of(),
+ List.of(hostName3));
}
private void verifyNodesInGroupWithoutRemarks(ScopedApplicationApi scopedApi,