summaryrefslogtreecommitdiffstats
path: root/container-core
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-09-09 16:37:46 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2022-09-09 16:37:46 +0200
commitc6552160827cd02d3aa0c0439f15be1823dc754a (patch)
tree3aa263f7f69637cba465a8ec0308125fc7ab6777 /container-core
parente0dcdda7286506373b2f60e657afb931ca5edf8b (diff)
soonActive => targetActive
Wire in targetActive in MonitorReply/Pong.
Diffstat (limited to 'container-core')
-rw-r--r--container-core/abi-spec.json4
-rw-r--r--container-core/src/main/java/com/yahoo/container/handler/Coverage.java28
-rw-r--r--container-core/src/main/java/com/yahoo/container/logging/Coverage.java8
3 files changed, 15 insertions, 25 deletions
diff --git a/container-core/abi-spec.json b/container-core/abi-spec.json
index 9c14c03ba21..6e4fc74fdc6 100644
--- a/container-core/abi-spec.json
+++ b/container-core/abi-spec.json
@@ -207,7 +207,7 @@
"public void merge(com.yahoo.container.handler.Coverage)",
"public long getDocs()",
"public long getActive()",
- "public long getSoonActive()",
+ "public long getTargetActive()",
"public boolean isDegraded()",
"public boolean isDegradedByMatchPhase()",
"public boolean isDegradedByTimeout()",
@@ -225,7 +225,7 @@
"fields": [
"protected long docs",
"protected long active",
- "protected long soonActive",
+ "protected long targetActive",
"protected int degradedReason",
"protected int nodes",
"protected int resultSets",
diff --git a/container-core/src/main/java/com/yahoo/container/handler/Coverage.java b/container-core/src/main/java/com/yahoo/container/handler/Coverage.java
index 09ddccc4204..3f8d085af9e 100644
--- a/container-core/src/main/java/com/yahoo/container/handler/Coverage.java
+++ b/container-core/src/main/java/com/yahoo/container/handler/Coverage.java
@@ -1,9 +1,6 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.container.handler;
-
-import com.yahoo.api.annotations.Beta;
-
/**
* The coverage report for a result set.
*
@@ -14,7 +11,7 @@ public class Coverage {
protected long docs;
protected long active;
- protected long soonActive;
+ protected long targetActive;
protected int degradedReason;
protected int nodes;
private int nodesTried;
@@ -55,7 +52,7 @@ public class Coverage {
this.nodes = nodes;
this.nodesTried = nodes;
this.active = active;
- this.soonActive = active;
+ this.targetActive = active;
this.degradedReason = 0;
this.resultSets = resultSets;
this.fullReason = fullReason;
@@ -69,7 +66,7 @@ public class Coverage {
nodes += other.getNodes();
nodesTried += other.nodesTried;
active += other.getActive();
- soonActive += other.getSoonActive();
+ targetActive += other.getTargetActive();
degradedReason |= other.degradedReason;
resultSets += other.getResultSets();
fullResultSets += other.getFullResultSets();
@@ -104,10 +101,8 @@ public class Coverage {
/**
* Returns the total number of documents that will be searchable once redistribution has settled.
- * Still in beta, semantics not finalized yet.
*/
- @Beta
- public long getSoonActive() { return soonActive; }
+ public long getTargetActive() { return targetActive; }
public boolean isDegraded() { return (degradedReason != 0) || isDegradedByNonIdealState(); }
public boolean isDegradedByMatchPhase() { return (degradedReason & DEGRADED_BY_MATCH_PHASE) != 0; }
@@ -117,16 +112,11 @@ public class Coverage {
/** Returns whether the search had full coverage or not */
public boolean getFull() {
- switch (fullReason) {
- case EXPLICITLY_FULL:
- return true;
- case EXPLICITLY_INCOMPLETE:
- return false;
- case DOCUMENT_COUNT:
- return docs == active;
- default:
- throw new IllegalStateException("Implementation out of sync. Please report this as a bug.");
- }
+ return switch (fullReason) {
+ case EXPLICITLY_FULL: yield true;
+ case EXPLICITLY_INCOMPLETE: yield false;
+ case DOCUMENT_COUNT: yield docs == active;
+ };
}
/** Returns the number of search instances which participated successfully in the search. */
diff --git a/container-core/src/main/java/com/yahoo/container/logging/Coverage.java b/container-core/src/main/java/com/yahoo/container/logging/Coverage.java
index d952cbd7490..98d685393dc 100644
--- a/container-core/src/main/java/com/yahoo/container/logging/Coverage.java
+++ b/container-core/src/main/java/com/yahoo/container/logging/Coverage.java
@@ -7,15 +7,15 @@ package com.yahoo.container.logging;
public class Coverage {
private final long docs;
private final long active;
- private final long soonActive;
+ private final long targetActive;
private final int degradedReason;
private final static int DEGRADED_BY_MATCH_PHASE = 1;
private final static int DEGRADED_BY_TIMEOUT = 2;
private final static int DEGRADED_BY_ADAPTIVE_TIMEOUT = 4;
- public Coverage(long docs, long active, long soonActive, int degradedReason) {
+ public Coverage(long docs, long active, long targetActive, int degradedReason) {
this.docs = docs;
this.active = active;
- this.soonActive = soonActive;
+ this.targetActive = targetActive;
this.degradedReason = degradedReason;
}
@@ -41,7 +41,7 @@ public class Coverage {
return v;
}
- public long getTargetActive() { return soonActive; }
+ public long getTargetActive() { return targetActive; }
public boolean isDegraded() { return (degradedReason != 0) || isDegradedByNonIdealState(); }
public boolean isDegradedByMatchPhase() { return (degradedReason & DEGRADED_BY_MATCH_PHASE) != 0; }