From 8e2abfc58e936bd6be3194f9e02a21a9b70b7692 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Thu, 24 Nov 2022 12:10:45 +0100 Subject: Put loadbalancer and invokerfactory in a volatile object to ensure atomic switch when reconfiguring. --- .../main/java/com/yahoo/search/dispatch/searchcluster/Group.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'container-search/src/main/java/com/yahoo/search/dispatch/searchcluster/Group.java') diff --git a/container-search/src/main/java/com/yahoo/search/dispatch/searchcluster/Group.java b/container-search/src/main/java/com/yahoo/search/dispatch/searchcluster/Group.java index cf161638104..fbea58054da 100644 --- a/container-search/src/main/java/com/yahoo/search/dispatch/searchcluster/Group.java +++ b/container-search/src/main/java/com/yahoo/search/dispatch/searchcluster/Group.java @@ -1,8 +1,6 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.search.dispatch.searchcluster; -import com.google.common.collect.ImmutableList; - import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; @@ -22,7 +20,7 @@ public class Group { private final static int minDocsPerNodeToRequireLowSkew = 100; private final int id; - private final ImmutableList nodes; + private final List nodes; private final AtomicBoolean hasSufficientCoverage = new AtomicBoolean(true); private final AtomicBoolean hasFullCoverage = new AtomicBoolean(true); private final AtomicLong activeDocuments = new AtomicLong(0); @@ -32,7 +30,7 @@ public class Group { public Group(int id, List nodes) { this.id = id; - this.nodes = ImmutableList.copyOf(nodes); + this.nodes = List.copyOf(nodes); int idx = 0; for(var node: nodes) { @@ -48,7 +46,7 @@ public class Group { public int id() { return id; } /** Returns the nodes in this group as an immutable list */ - public ImmutableList nodes() { return nodes; } + public List nodes() { return nodes; } /** * Returns whether this group has sufficient active documents -- cgit v1.2.3