diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-12-04 22:42:13 +0100 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-12-04 22:42:13 +0100 |
commit | fd54b4e4b136b05b67b471dca3ca6ce3dd116710 (patch) | |
tree | 88ab77cc41620eb2b8639b10b7edd1e57b901f12 /orchestrator | |
parent | fae49834f53500587921196e86ee4af4c670d8c9 (diff) |
Revert collect(Collectors.toList())
Diffstat (limited to 'orchestrator')
12 files changed, 18 insertions, 18 deletions
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/OrchestratorUtil.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/OrchestratorUtil.java index 3093a2a9828..54b0bc4ddd1 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/OrchestratorUtil.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/OrchestratorUtil.java @@ -76,7 +76,7 @@ public class OrchestratorUtil { Set<ApplicationInstanceReference> references = serviceMonitor.getAllApplicationInstanceReferences(); List<ApplicationInstanceReference> referencesWithId = references.stream() .filter(a -> OrchestratorUtil.toApplicationId(a).equals(applicationid)) - .toList(); + .collect(Collectors.toList()); if (referencesWithId.size() > 1) { String msg = String.format("ApplicationId '%s' was not unique but mapped to '%s'", applicationid, referencesWithId); 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 1887d19621e..25567cb00a1 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 @@ -167,7 +167,7 @@ public class ClusterControllerClientImpl implements ClusterControllerClient { // * if host 2 responds, it will redirect to master if necessary; otherwise // * if host 3 responds, it may redirect to master if necessary (if they're up // after all), but more likely there's no quorum and this will fail too. - : HostStrategy.ordered(hosts.stream().map(ClusterControllerClientImpl::toUrl).toList()); + : HostStrategy.ordered(hosts.stream().map(ClusterControllerClientImpl::toUrl).collect(Collectors.toList())); } static URI toUrl(HostName host) { diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ClusterApiImpl.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ClusterApiImpl.java index a276c08080b..4a10cde66b3 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ClusterApiImpl.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ClusterApiImpl.java @@ -196,7 +196,7 @@ class ClusterApiImpl implements ClusterApi { description.append(" "); final int nodeLimit = 3; - description.append(suspended.stream().sorted().distinct().limit(nodeLimit).toList().toString()); + description.append(suspended.stream().sorted().distinct().limit(nodeLimit).collect(Collectors.toList()).toString()); if (suspended.size() > nodeLimit) { description.append(" and " + (suspended.size() - nodeLimit) + " others"); } @@ -216,7 +216,7 @@ class ClusterApiImpl implements ClusterApi { downElsewhere.stream().map(ServiceInstance::toString).sorted(), missingServices > 0 ? Stream.of(descriptionOfMissingServices) : Stream.of()) .limit(serviceLimit) - .toList() + .collect(Collectors.toList()) .toString()); if (downElsewhereTotal > serviceLimit) { diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/NodeGroup.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/NodeGroup.java index 9a6fc75944d..c4bcb48a6a6 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/NodeGroup.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/NodeGroup.java @@ -43,7 +43,7 @@ public class NodeGroup { } public List<HostName> getHostNames() { - return hostNames.stream().sorted().toList(); + return hostNames.stream().sorted().collect(Collectors.toList()); } public String toCommaSeparatedString() { 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 f2133d32867..a869a3e84b0 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 @@ -94,7 +94,7 @@ public class VespaModelUtil { return clusterControllerInstances.stream() .sorted(CLUSTER_CONTROLLER_INDEX_COMPARATOR) .map(serviceInstance -> serviceInstance.hostName()) - .toList(); + .collect(Collectors.toList()); } private static Collection<ServiceCluster> filter(Set<ServiceCluster> controllerClusters, diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/SuspensionReasons.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/SuspensionReasons.java index cc4d1b7d7a0..ba2b1c716d9 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/SuspensionReasons.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/SuspensionReasons.java @@ -49,7 +49,7 @@ public class SuspensionReasons { /** An ordered list of all messages, typically useful for testing. */ public List<String> getMessagesInOrder() { - return reasons.values().stream().flatMap(Collection::stream).sorted().toList(); + return reasons.values().stream().flatMap(Collection::stream).sorted().collect(Collectors.toList()); } public SuspensionReasons mergeWith(SuspensionReasons that) { diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/HealthRequestHandler.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/HealthRequestHandler.java index 079eff4f777..7e157eade1b 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/HealthRequestHandler.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/HealthRequestHandler.java @@ -56,7 +56,7 @@ public class HealthRequestHandler extends RestApiRequestHandler<HealthRequestHan .withPath(Path.parse("/orchestrator/v1/health/" + applicationId.serializedForm())) .toString(); return reference; - }).toList(); + }).collect(Collectors.toList()); return list; } @@ -75,7 +75,7 @@ public class HealthRequestHandler extends RestApiRequestHandler<HealthRequestHan return serviceResource; }) .sorted(Comparator.comparing(resource -> resource.serviceType.s())) - .toList(); + .collect(Collectors.toList()); ApplicationServices applicationServices = new ApplicationServices(); applicationServices.services = serviceResources; diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/HostRequestHandler.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/HostRequestHandler.java index 3119c425d5f..44a095bbc64 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/HostRequestHandler.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/HostRequestHandler.java @@ -82,7 +82,7 @@ public class HostRequestHandler extends RestApiRequestHandler<HostRequestHandler serviceInstance.getServiceCluster().serviceType().s(), serviceInstance.configId().s(), serviceInstance.serviceStatus().name())) - .toList(); + .collect(Collectors.toList()); return new GetHostResponse( host.getHostName().s(), diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/HostSuspensionRequestHandler.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/HostSuspensionRequestHandler.java index 205fea4dfcf..f1d7ae3857c 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/HostSuspensionRequestHandler.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/HostSuspensionRequestHandler.java @@ -50,7 +50,7 @@ public class HostSuspensionRequestHandler extends RestApiRequestHandler<HostSusp List<String> hostnamesAsStrings = context.queryParameters().getStringList("hostname"); HostName parentHostname = new HostName(parentHostnameString); - List<HostName> hostnames = hostnamesAsStrings.stream().map(HostName::new).toList(); + List<HostName> hostnames = hostnamesAsStrings.stream().map(HostName::new).collect(Collectors.toList()); try { orchestrator.suspendAll(parentHostname, hostnames); } catch (BatchHostStateChangeDeniedException e) { diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/InstanceRequestHandler.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/InstanceRequestHandler.java index 0964a3f7dd5..16f55d9ec9b 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/InstanceRequestHandler.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/InstanceRequestHandler.java @@ -90,7 +90,7 @@ public class InstanceRequestHandler extends RestApiRequestHandler<InstanceReques } private List<ApplicationInstanceReference> getAllInstances(RestApi.RequestContext context) { - return serviceMonitor.getAllApplicationInstanceReferences().stream().sorted().toList(); + return serviceMonitor.getAllApplicationInstanceReferences().stream().sorted().collect(Collectors.toList()); } private InstanceStatusResponse getInstance(RestApi.RequestContext context) { @@ -132,7 +132,7 @@ public class InstanceRequestHandler extends RestApiRequestHandler<InstanceReques List<Mirror.Entry> entries = slobrokApi.lookup(applicationId, pattern); return entries.stream() .map(entry -> new SlobrokEntryResponse(entry.getName(), entry.getSpecString())) - .toList(); + .collect(Collectors.toList()); } private ServiceStatusInfo getServiceStatus(RestApi.RequestContext context) { 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..a3054703b61 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 @@ -155,7 +155,7 @@ public class ApplicationApiImplTest { try (scopedApi) { List<HostName> upStorageNodes = scopedApi.applicationApi().getNoRemarksStorageNodesInGroupInClusterOrder().stream() .map(storageNode -> storageNode.hostName()) - .toList(); + .collect(Collectors.toList()); assertEquals(Arrays.asList(expectedHostNames), upStorageNodes); } } @@ -192,7 +192,7 @@ public class ApplicationApiImplTest { .getNoRemarksStorageNodesInGroupInClusterOrder() .stream() .map(storageNode -> storageNode.hostName()) - .toList(); + .collect(Collectors.toList()); assertEquals(upStorageNodes, actualStorageNodes); } } @@ -344,7 +344,7 @@ public class ApplicationApiImplTest { .getSuspendedStorageNodesInGroupInReverseClusterOrder() .stream() .map(storageNode -> storageNode.hostName()) - .toList(); + .collect(Collectors.toList()); assertEquals(Arrays.asList(hostNames), actualStorageNodes); } } diff --git a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/model/ClusterApiImplTest.java b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/model/ClusterApiImplTest.java index b073f546cce..1563a54a029 100644 --- a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/model/ClusterApiImplTest.java +++ b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/model/ClusterApiImplTest.java @@ -126,7 +126,7 @@ public class ClusterApiImplTest { var hostnames = IntStream.rangeClosed(1, serviceStatusList.size()) .mapToObj(i -> new HostName("cfg" + i)) - .toList(); + .collect(Collectors.toList()); var instances = new ArrayList<ServiceInstance>(); for (int i = 0; i < hostnames.size(); i++) { instances.add(modelUtils.createServiceInstance("cs" + i + 1, hostnames.get(i), serviceStatusList.get(i))); @@ -371,7 +371,7 @@ public class ClusterApiImplTest { serviceStatusList.addAll(List.of(rest)); var hostnames = IntStream.rangeClosed(1, serviceStatusList.size()) .mapToObj(i -> new HostName("cfg" + i)) - .toList(); + .collect(Collectors.toList()); var instances = new ArrayList<ServiceInstance>(); for (int i = 0; i < hostnames.size(); i++) { instances.add(modelUtils.createServiceInstance("cs" + i + 1, hostnames.get(i), serviceStatusList.get(i))); |