summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/content/Redundancy.java4
-rw-r--r--container-core/src/main/java/com/yahoo/processing/test/ProcessorLibrary.java1
-rw-r--r--container-search/src/test/java/com/yahoo/search/searchchain/test/AsyncExecutionOfOneChainTestCase.java12
3 files changed, 10 insertions, 7 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/Redundancy.java b/config-model/src/main/java/com/yahoo/vespa/model/content/Redundancy.java
index 706d9a01c82..ba968411393 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/content/Redundancy.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/content/Redundancy.java
@@ -29,12 +29,16 @@ public class Redundancy implements StorDistributionConfig.Producer, ProtonConfig
this.totalNodes = totalNodes;
}
+ /** Returns the final redundancy per group */
public int finalRedundancy() { return effectiveFinalRedundancy()/groups; }
+
public int readyCopies() { return effectiveReadyCopies()/groups; }
public int groups() { return groups; }
public int totalNodes() { return totalNodes; }
public int effectiveInitialRedundancy() { return Math.min(totalNodes, initialRedundancy * groups); }
+
+ /** Returns the final redundancy over all groups */
public int effectiveFinalRedundancy() { return Math.min(totalNodes, finalRedundancy * groups); }
public int effectiveReadyCopies() { return Math.min(totalNodes, readyCopies * groups); }
diff --git a/container-core/src/main/java/com/yahoo/processing/test/ProcessorLibrary.java b/container-core/src/main/java/com/yahoo/processing/test/ProcessorLibrary.java
index 5f6201c6f2d..fc8904bee7f 100644
--- a/container-core/src/main/java/com/yahoo/processing/test/ProcessorLibrary.java
+++ b/container-core/src/main/java/com/yahoo/processing/test/ProcessorLibrary.java
@@ -169,7 +169,6 @@ public class ProcessorLibrary {
List<FutureResponse> futureResponses = new ArrayList<>(chains.size());
for (Chain<? extends Processor> chain : chains) {
-
futureResponses.add(new AsyncExecution(chain, execution).process(request.clone()));
}
AsyncExecution.waitForAll(futureResponses, 1000);
diff --git a/container-search/src/test/java/com/yahoo/search/searchchain/test/AsyncExecutionOfOneChainTestCase.java b/container-search/src/test/java/com/yahoo/search/searchchain/test/AsyncExecutionOfOneChainTestCase.java
index 182ec7568f3..28ad202c4f5 100644
--- a/container-search/src/test/java/com/yahoo/search/searchchain/test/AsyncExecutionOfOneChainTestCase.java
+++ b/container-search/src/test/java/com/yahoo/search/searchchain/test/AsyncExecutionOfOneChainTestCase.java
@@ -48,20 +48,20 @@ public class AsyncExecutionOfOneChainTestCase {
private class ParallelExecutor extends Searcher {
/** The number of parallel executions */
- private static final int parallelism=2;
+ private static final int parallelism = 2;
@Override
public Result search(Query query, Execution execution) {
- List<FutureResult> futureResults=new ArrayList<>(parallelism);
- for (int i=0; i<parallelism; i++)
+ List<FutureResult> futureResults = new ArrayList<>(parallelism);
+ for (int i = 0; i < parallelism; i++)
futureResults.add(new AsyncExecution(execution).search(query.clone()));
- Result mainResult=execution.search(query);
+ Result mainResult = execution.search(query);
// Add hits from other threads
AsyncExecution.waitForAll(futureResults,query.getTimeLeft());
for (FutureResult futureResult : futureResults) {
- Result result=futureResult.get();
+ Result result = futureResult.get();
mainResult.mergeWith(result);
mainResult.hits().addAll(result.hits().asList());
}
@@ -72,7 +72,7 @@ public class AsyncExecutionOfOneChainTestCase {
private static class RegularProvider extends Searcher {
- private AtomicInteger counter=new AtomicInteger();
+ private final AtomicInteger counter = new AtomicInteger();
@Override
public Result search(Query query,Execution execution) {