diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-12-02 22:37:16 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-12-02 22:37:16 +0000 |
commit | 6954a0d10fddb9bee32931ba69b2d4b427ee71e2 (patch) | |
tree | 21e6aad059615f27c6357227e6af608a7b965ec5 /orchestrator/src/main | |
parent | afcf1bb71cb7b87a03149d197f724cfc7603ef92 (diff) |
collect(Collectors.toList()) -> toList()
Diffstat (limited to 'orchestrator/src/main')
10 files changed, 13 insertions, 13 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 54b0bc4ddd1..3093a2a9828 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)) - .collect(Collectors.toList()); + .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 25567cb00a1..1887d19621e 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).collect(Collectors.toList())); + : HostStrategy.ordered(hosts.stream().map(ClusterControllerClientImpl::toUrl).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 4a10cde66b3..a276c08080b 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).collect(Collectors.toList()).toString()); + description.append(suspended.stream().sorted().distinct().limit(nodeLimit).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) - .collect(Collectors.toList()) + .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 c4bcb48a6a6..9a6fc75944d 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().collect(Collectors.toList()); + return hostNames.stream().sorted().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 a869a3e84b0..f2133d32867 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()) - .collect(Collectors.toList()); + .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 ba2b1c716d9..cc4d1b7d7a0 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().collect(Collectors.toList()); + return reasons.values().stream().flatMap(Collection::stream).sorted().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 7e157eade1b..079eff4f777 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; - }).collect(Collectors.toList()); + }).toList(); return list; } @@ -75,7 +75,7 @@ public class HealthRequestHandler extends RestApiRequestHandler<HealthRequestHan return serviceResource; }) .sorted(Comparator.comparing(resource -> resource.serviceType.s())) - .collect(Collectors.toList()); + .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 44a095bbc64..3119c425d5f 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())) - .collect(Collectors.toList()); + .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 f1d7ae3857c..205fea4dfcf 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).collect(Collectors.toList()); + List<HostName> hostnames = hostnamesAsStrings.stream().map(HostName::new).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 16f55d9ec9b..0964a3f7dd5 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().collect(Collectors.toList()); + return serviceMonitor.getAllApplicationInstanceReferences().stream().sorted().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())) - .collect(Collectors.toList()); + .toList(); } private ServiceStatusInfo getServiceStatus(RestApi.RequestContext context) { |