summaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/search/searchchain
diff options
context:
space:
mode:
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/searchchain')
-rw-r--r--container-search/src/main/java/com/yahoo/search/searchchain/AsyncExecution.java66
-rw-r--r--container-search/src/main/java/com/yahoo/search/searchchain/Execution.java127
-rw-r--r--container-search/src/main/java/com/yahoo/search/searchchain/ExecutionFactory.java30
-rw-r--r--container-search/src/main/java/com/yahoo/search/searchchain/ForkingSearcher.java2
-rw-r--r--container-search/src/main/java/com/yahoo/search/searchchain/FutureResult.java6
-rw-r--r--container-search/src/main/java/com/yahoo/search/searchchain/PhaseNames.java2
-rw-r--r--container-search/src/main/java/com/yahoo/search/searchchain/SearchChain.java2
-rw-r--r--container-search/src/main/java/com/yahoo/search/searchchain/SearchChainRegistry.java2
-rw-r--r--container-search/src/main/java/com/yahoo/search/searchchain/SearcherRegistry.java2
-rw-r--r--container-search/src/main/java/com/yahoo/search/searchchain/example/ExampleSearcher.java2
-rw-r--r--container-search/src/main/java/com/yahoo/search/searchchain/model/VespaSearchers.java2
-rw-r--r--container-search/src/main/java/com/yahoo/search/searchchain/model/federation/FederationOptions.java2
-rw-r--r--container-search/src/main/java/com/yahoo/search/searchchain/model/federation/FederationSearcherModel.java2
-rw-r--r--container-search/src/main/java/com/yahoo/search/searchchain/model/federation/LocalProviderSpec.java2
-rw-r--r--container-search/src/main/java/com/yahoo/search/searchchain/model/federation/package-info.java2
-rw-r--r--container-search/src/main/java/com/yahoo/search/searchchain/model/package-info.java2
-rw-r--r--container-search/src/main/java/com/yahoo/search/searchchain/package-info.java2
-rw-r--r--container-search/src/main/java/com/yahoo/search/searchchain/testutil/DocumentSourceSearcher.java8
18 files changed, 151 insertions, 112 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/searchchain/AsyncExecution.java b/container-search/src/main/java/com/yahoo/search/searchchain/AsyncExecution.java
index 099f431d025..adab4d59ec0 100644
--- a/container-search/src/main/java/com/yahoo/search/searchchain/AsyncExecution.java
+++ b/container-search/src/main/java/com/yahoo/search/searchchain/AsyncExecution.java
@@ -1,8 +1,7 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.searchchain;
import com.yahoo.component.chain.Chain;
-import com.yahoo.concurrent.ThreadFactoryFactory;
import com.yahoo.search.Query;
import com.yahoo.search.Result;
import com.yahoo.search.Searcher;
@@ -10,7 +9,14 @@ import com.yahoo.search.Searcher;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
-import java.util.concurrent.*;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Executor;
+import java.util.concurrent.Future;
+import java.util.concurrent.FutureTask;
+import java.util.concurrent.RejectedExecutionException;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
/**
* Provides asynchronous execution of searchchains.
@@ -44,20 +50,6 @@ import java.util.concurrent.*;
*/
public class AsyncExecution {
- private static final ThreadFactory threadFactory = ThreadFactoryFactory.getThreadFactory("search");
-
- private static final Executor executorMain = createExecutor();
-
- private static Executor createExecutor() {
- ThreadPoolExecutor executor = new ThreadPoolExecutor(100, 8192, 1L, TimeUnit.SECONDS,
- new SynchronousQueue<>(false), threadFactory);
- // Prestart needed, if not all threads will be created by the fist N tasks and hence they might also
- // get the dreaded thread locals initialized even if they will never run.
- // That counters what we we want to achieve with the Q that will prefer thread locality.
- executor.prestartAllCoreThreads();
- return executor;
- }
-
/** The execution this executes */
private final Execution execution;
@@ -118,50 +110,53 @@ public class AsyncExecution {
* @see com.yahoo.search.searchchain.Execution
*/
public FutureResult search(Query query) {
- return getFutureResult(() -> execution.search(query), query);
+ return getFutureResult(execution.context().executor(), () -> execution.search(query), query);
}
public FutureResult searchAndFill(Query query) {
- return getFutureResult(() -> {
+ return getFutureResult(execution.context().executor(), () -> {
Result result = execution.search(query);
execution.fill(result, query.getPresentation().getSummary());
return result;
}, query);
}
- private static Executor getExecutor() {
- return executorMain;
- }
-
/**
* The future of this functions returns the original Result
*
* @see com.yahoo.search.searchchain.Execution
*/
public FutureResult fill(Result result, String summaryClass) {
- return getFutureResult(() -> {
+ return getFutureResult(execution.context().executor(), () -> {
execution.fill(result, summaryClass);
return result;
}, result.getQuery());
-
}
- private static <T> Future<T> getFuture(Callable<T> callable) {
+ private static <T> Future<T> getFuture(Executor executor, Callable<T> callable) {
FutureTask<T> future = new FutureTask<>(callable);
- getExecutor().execute(future);
+ try {
+ executor.execute(future);
+ } catch (RejectedExecutionException e) {
+ future.run();
+ }
return future;
}
- private static Future<Void> runTask(Runnable runnable) {
- return getFuture(() -> {
+ private static Future<Void> runTask(Executor executor, Runnable runnable) {
+ return getFuture(executor, () -> {
runnable.run();
return null;
});
}
- private FutureResult getFutureResult(Callable<Result> callable, Query query) {
+ private FutureResult getFutureResult(Executor executor, Callable<Result> callable, Query query) {
FutureResult future = new FutureResult(callable, execution, query);
- getExecutor().execute(future);
+ try {
+ executor.execute(future);
+ } catch (RejectedExecutionException e) {
+ future.run();
+ }
return future;
}
@@ -170,16 +165,17 @@ public class AsyncExecution {
* done when the timeout expires, it will be cancelled, and it will return a
* result. All unfinished Futures will be cancelled.
*
- * @return the list of results in the same order as returned from the task
- * collection
+ * @return the list of results in the same order as returned from the task collection
*/
public static List<Result> waitForAll(Collection<FutureResult> tasks, long timeoutMs) {
+ if (tasks.isEmpty()) return new ArrayList<>();
+
// Copy the list in case it is modified while we are waiting
List<FutureResult> workingTasks = new ArrayList<>(tasks);
try {
- runTask(() -> {
+ runTask(tasks.stream().findAny().get().getExecution().context().executor(), () -> {
for (FutureResult task : workingTasks)
- task.get();
+ task.get(timeoutMs, TimeUnit.MILLISECONDS);
}).get(timeoutMs, TimeUnit.MILLISECONDS);
} catch (TimeoutException | InterruptedException | ExecutionException e) {
// Handle timeouts below
diff --git a/container-search/src/main/java/com/yahoo/search/searchchain/Execution.java b/container-search/src/main/java/com/yahoo/search/searchchain/Execution.java
index fac0d35d509..c507069b948 100644
--- a/container-search/src/main/java/com/yahoo/search/searchchain/Execution.java
+++ b/container-search/src/main/java/com/yahoo/search/searchchain/Execution.java
@@ -1,8 +1,9 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.searchchain;
import com.yahoo.component.chain.Chain;
import com.yahoo.language.Linguistics;
+import com.yahoo.language.simple.SimpleLinguistics;
import com.yahoo.prelude.IndexFacts;
import com.yahoo.prelude.Ping;
import com.yahoo.prelude.Pong;
@@ -14,9 +15,14 @@ import com.yahoo.search.Query;
import com.yahoo.search.Result;
import com.yahoo.search.Searcher;
import com.yahoo.search.cluster.PingableSearcher;
+import com.yahoo.search.rendering.Renderer;
import com.yahoo.search.rendering.RendererRegistry;
import com.yahoo.search.statistics.TimeTracker;
+import java.util.Objects;
+import java.util.concurrent.Executor;
+import java.util.concurrent.Executors;
+
/**
* <p>An execution of a search chain. This keeps track of the call state for an execution (in the calling thread)
* of the searchers of a search chain.</p>
@@ -79,6 +85,8 @@ public class Execution extends com.yahoo.processing.execution.Execution {
/** The current linguistics */
private Linguistics linguistics = null;
+ private Executor executor;
+
/** Always set if this context belongs to an execution, never set if it does not. */
private final Execution owner;
@@ -89,10 +97,10 @@ public class Execution extends com.yahoo.processing.execution.Execution {
// package private.
/** Create a context used to carry state into another context */
- Context() { this.owner=null; }
+ Context() { this.owner = null; }
/** Create a context which belongs to an execution */
- Context(Execution owner) { this.owner=owner; }
+ Context(Execution owner) { this.owner = owner; }
/**
* Creates a context from arguments, all of which may be null, though
@@ -107,11 +115,9 @@ public class Execution extends com.yahoo.processing.execution.Execution {
* another context.
*/
public Context(SearchChainRegistry searchChainRegistry, IndexFacts indexFacts,
- SpecialTokenRegistry tokenRegistry, RendererRegistry rendererRegistry, Linguistics linguistics)
- {
+ SpecialTokenRegistry tokenRegistry, RendererRegistry rendererRegistry, Linguistics linguistics,
+ Executor executor) {
owner = null;
- // The next time something is added here, compose into wrapper objects. Many arguments...
-
// Four methods need to be updated when adding something:
// fill(Context), populateFrom(Context), equals(Context) and,
// obviously, the most complete constructor.
@@ -120,35 +126,51 @@ public class Execution extends com.yahoo.processing.execution.Execution {
this.tokenRegistry = tokenRegistry;
this.rendererRegistry = rendererRegistry;
this.linguistics = linguistics;
+ this.executor = Objects.requireNonNull(executor, "The executor cannot be null");
+ }
+
+ /** @deprecated pass an executor */
+ @Deprecated // TODO: Remove on Vespa 8
+ public Context(SearchChainRegistry searchChainRegistry, IndexFacts indexFacts,
+ SpecialTokenRegistry tokenRegistry, RendererRegistry rendererRegistry, Linguistics linguistics) {
+ this(searchChainRegistry, indexFacts, tokenRegistry, rendererRegistry, linguistics, Runnable::run);
}
- /** Creates a context stub with no information. This is for unit testing. */
+ /** Creates a Context instance where everything except the given arguments is empty. This is for unit testing.*/
public static Context createContextStub() {
- return new Context(null, null, null, null, null);
+ return createContextStub(null, null, null);
}
- /**
- * Create a Context instance where only the index related settings are
- * initialized. This is for unit testing.
- */
+ /** Creates a Context instance where everything except the given arguments is empty. This is for unit testing.*/
+ public static Context createContextStub(SearchChainRegistry searchChainRegistry) {
+ return createContextStub(searchChainRegistry, null, null);
+ }
+
+ /** Creates a Context instance where everything except the given arguments is empty. This is for unit testing.*/
public static Context createContextStub(IndexFacts indexFacts) {
- return new Context(null, indexFacts, null, null, null);
+ return createContextStub(null, indexFacts, null);
}
- /**
- * Create a Context instance where only the search chain registry and index facts are
- * initialized. This is for unit testing.
- */
+ /** Creates a Context instance where everything except the given arguments is empty. This is for unit testing.*/
public static Context createContextStub(SearchChainRegistry searchChainRegistry, IndexFacts indexFacts) {
- return new Context(searchChainRegistry, indexFacts, null, null, null);
+ return createContextStub(searchChainRegistry, indexFacts, null);
}
- /**
- * Create a Context instance where only the search chain registry, index facts and linguistics are
- * initialized. This is for unit testing.
- */
- public static Context createContextStub(SearchChainRegistry searchChainRegistry, IndexFacts indexFacts, Linguistics linguistics) {
- return new Context(searchChainRegistry, indexFacts, null, null, linguistics);
+ /** Creates a Context instance where everything except the given arguments is empty. This is for unit testing.*/
+ public static Context createContextStub(IndexFacts indexFacts, Linguistics linguistics) {
+ return createContextStub(null, indexFacts, linguistics);
+ }
+
+ /** Creates a Context instance where everything except the given arguments is empty. This is for unit testing.*/
+ public static Context createContextStub(SearchChainRegistry searchChainRegistry,
+ IndexFacts indexFacts,
+ Linguistics linguistics) {
+ return new Context(searchChainRegistry != null ? searchChainRegistry : new SearchChainRegistry(),
+ indexFacts != null ? indexFacts : new IndexFacts(),
+ null,
+ new RendererRegistry(Runnable::run),
+ linguistics != null ? linguistics : new SimpleLinguistics(),
+ Executors.newSingleThreadExecutor());
}
/**
@@ -157,25 +179,22 @@ public class Execution extends com.yahoo.processing.execution.Execution {
*
* @param sourceContext the context from which to get the parameters
*/
+ // TODO: Deprecate
public void populateFrom(Context sourceContext) {
// breakdown and detailedDiagnostics has no unset state, so they are always copied
detailedDiagnostics = sourceContext.detailedDiagnostics;
breakdown = sourceContext.breakdown;
- if (indexFacts == null) {
+ if (indexFacts == null)
indexFacts = sourceContext.indexFacts;
- }
- if (tokenRegistry == null) {
+ if (tokenRegistry == null)
tokenRegistry = sourceContext.tokenRegistry;
- }
- if (searchChainRegistry == null) {
+ if (searchChainRegistry == null)
searchChainRegistry = sourceContext.searchChainRegistry;
- }
- if (rendererRegistry == null) {
+ if (rendererRegistry == null)
rendererRegistry = sourceContext.rendererRegistry;
- }
- if (linguistics == null) {
+ if (linguistics == null)
linguistics = sourceContext.linguistics;
- }
+ executor = sourceContext.executor; // executor will always either be the same, or we're in a test
}
/**
@@ -191,6 +210,7 @@ public class Execution extends com.yahoo.processing.execution.Execution {
detailedDiagnostics = other.detailedDiagnostics;
breakdown = other.breakdown;
linguistics = other.linguistics;
+ executor = other.executor;
}
public boolean equals(Context other) {
@@ -202,7 +222,8 @@ public class Execution extends com.yahoo.processing.execution.Execution {
&& other.searchChainRegistry == searchChainRegistry
&& other.detailedDiagnostics == detailedDiagnostics
&& other.breakdown == breakdown
- && other.linguistics == linguistics;
+ && other.linguistics == linguistics
+ && other.executor == executor;
}
@Override
@@ -210,19 +231,15 @@ public class Execution extends com.yahoo.processing.execution.Execution {
return java.util.Objects.hash(indexFacts,
rendererRegistry, tokenRegistry, searchChainRegistry,
detailedDiagnostics, breakdown,
- linguistics);
+ linguistics,
+ executor);
}
@Override
public boolean equals(Object other) {
- if (other == null) {
- return false;
- }
- if (other.getClass() != Context.class) {
- return false;
- } else {
- return equals((Context) other);
- }
+ if (other == null) return false;
+ if (other.getClass() != Context.class) return false;
+ return equals((Context) other);
}
/**
@@ -268,9 +285,7 @@ public class Execution extends com.yahoo.processing.execution.Execution {
* IndexFacts instance in a subclass. E.g.
* execution.context().setIndexFacts(new WrapperClass(execution.context().getIndexFacts())).
*
- * @param indexFacts
- * an instance to override the following searcher's view of
- * the indexes.
+ * @param indexFacts an instance to override the following searcher's view of the indexes
*/
public void setIndexFacts(IndexFacts indexFacts) {
this.indexFacts = indexFacts;
@@ -294,9 +309,7 @@ public class Execution extends com.yahoo.processing.execution.Execution {
return rendererRegistry;
}
- /**
- * @return the current set of special strings for the query tokenizer
- */
+ /** Returns the current set of special strings for the query tokenizer */
public SpecialTokenRegistry getTokenRegistry() {
return tokenRegistry;
}
@@ -359,6 +372,12 @@ public class Execution extends com.yahoo.processing.execution.Execution {
this.linguistics = linguistics;
}
+ /**
+ * Returns the executor that should be used to execute tasks as part of this execution.
+ * This is never null but will be an executor that runs a single thread if none is passed to this.
+ */
+ public Executor executor() { return executor; }
+
/** Creates a child trace if this has an owner, or a root trace otherwise */
private Trace createChildTrace() {
return owner!=null ? owner.trace().createChild() : Trace.createRoot(0);
@@ -469,7 +488,7 @@ public class Execution extends com.yahoo.processing.execution.Execution {
// "if any" because a context may, or may not, belong to an execution.
// This is decided at the creation time of the Context - Context instances which do not belong
// to an execution plays the role of data carriers between executions.
- super(searchChain,searcherIndex,context.createChildTrace(),context.createChildEnvironment());
+ super(searchChain, searcherIndex, context.createChildTrace(), context.createChildEnvironment());
this.context.fill(context);
contextCache = new Context[searchChain.components().size()];
entryIndex=searcherIndex;
@@ -556,7 +575,7 @@ public class Execution extends com.yahoo.processing.execution.Execution {
}
finally {
previousProcessor();
- onReturningFill(current, result, summaryClass);
+ onReturningFill(current, summaryClass);
timer.sampleFillReturn(nextIndex(), context.getDetailedDiagnostics(), result);
}
}
@@ -567,7 +586,7 @@ public class Execution extends com.yahoo.processing.execution.Execution {
trace().trace("Invoke fill(" + summaryClass + ") on " + searcher, traceFillAt);
}
- private void onReturningFill(Searcher searcher, Result result, String summaryClass) {
+ private void onReturningFill(Searcher searcher, String summaryClass) {
int traceFillAt = 5;
if (trace().getTraceLevel() < traceFillAt) return;
trace().trace("Return fill(" + summaryClass + ") on " + searcher, traceFillAt);
diff --git a/container-search/src/main/java/com/yahoo/search/searchchain/ExecutionFactory.java b/container-search/src/main/java/com/yahoo/search/searchchain/ExecutionFactory.java
index a813229c984..076bdf92570 100644
--- a/container-search/src/main/java/com/yahoo/search/searchchain/ExecutionFactory.java
+++ b/container-search/src/main/java/com/yahoo/search/searchchain/ExecutionFactory.java
@@ -1,6 +1,7 @@
// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.searchchain;
+import com.google.inject.Inject;
import com.yahoo.component.AbstractComponent;
import com.yahoo.component.chain.Chain;
import com.yahoo.component.chain.ChainsConfigurer;
@@ -9,6 +10,7 @@ import com.yahoo.component.chain.model.ChainsModelBuilder;
import com.yahoo.component.provider.ComponentRegistry;
import com.yahoo.container.QrSearchersConfig;
import com.yahoo.container.core.ChainsConfig;
+import com.yahoo.container.handler.threadpool.ContainerThreadPool;
import com.yahoo.language.Linguistics;
import com.yahoo.language.simple.SimpleLinguistics;
import com.yahoo.prelude.IndexFacts;
@@ -20,6 +22,9 @@ import com.yahoo.search.config.IndexInfoConfig;
import com.yahoo.search.rendering.RendererRegistry;
import com.yahoo.vespa.configdefinition.SpecialtokensConfig;
+import java.util.concurrent.Executor;
+import java.util.concurrent.Executors;
+
/**
* Provides creation of fully configured query Execution instances.
* Have an instance of this injected if you need to execute queries which are not initiated from
@@ -34,19 +39,35 @@ public class ExecutionFactory extends AbstractComponent {
private final SpecialTokenRegistry specialTokens;
private final Linguistics linguistics;
private final RendererRegistry rendererRegistry;
+ private final Executor executor;
+ @Inject
public ExecutionFactory(ChainsConfig chainsConfig,
IndexInfoConfig indexInfo,
QrSearchersConfig clusters,
ComponentRegistry<Searcher> searchers,
SpecialtokensConfig specialTokens,
Linguistics linguistics,
- ComponentRegistry<Renderer> renderers) {
+ ComponentRegistry<Renderer> renderers,
+ Executor executor) {
this.searchChainRegistry = createSearchChainRegistry(searchers, chainsConfig);
this.indexFacts = new IndexFacts(new IndexModel(indexInfo, clusters)).freeze();
this.specialTokens = new SpecialTokenRegistry(specialTokens);
this.linguistics = linguistics;
this.rendererRegistry = new RendererRegistry(renderers.allComponents());
+ this.executor = executor != null ? executor : Executors.newSingleThreadExecutor();
+ }
+
+ /** @deprecated pass the container threadpool */
+ @Deprecated // TODO: Remove on Vespa 8
+ public ExecutionFactory(ChainsConfig chainsConfig,
+ IndexInfoConfig indexInfo,
+ QrSearchersConfig clusters,
+ ComponentRegistry<Searcher> searchers,
+ SpecialtokensConfig specialTokens,
+ Linguistics linguistics,
+ ComponentRegistry<Renderer> renderers) {
+ this(chainsConfig, indexInfo, clusters, searchers, specialTokens, linguistics, renderers, (Executor)null);
}
private SearchChainRegistry createSearchChainRegistry(ComponentRegistry<Searcher> searchers, ChainsConfig chainsConfig) {
@@ -63,7 +84,7 @@ public class ExecutionFactory extends AbstractComponent {
*/
public Execution newExecution(Chain<? extends Searcher> searchChain) {
return new Execution(searchChain,
- new Execution.Context(searchChainRegistry, indexFacts, specialTokens, rendererRegistry, linguistics));
+ new Execution.Context(searchChainRegistry, indexFacts, specialTokens, rendererRegistry, linguistics, executor));
}
/**
@@ -72,7 +93,7 @@ public class ExecutionFactory extends AbstractComponent {
*/
public Execution newExecution(String searchChainId) {
return new Execution(searchChainRegistry().getChain(searchChainId),
- new Execution.Context(searchChainRegistry, indexFacts, specialTokens, rendererRegistry, linguistics));
+ new Execution.Context(searchChainRegistry, indexFacts, specialTokens, rendererRegistry, linguistics, executor));
}
/** Returns the search chain registry used by this */
@@ -93,7 +114,8 @@ public class ExecutionFactory extends AbstractComponent {
new ComponentRegistry<>(),
new SpecialtokensConfig.Builder().build(),
new SimpleLinguistics(),
- new ComponentRegistry<>());
+ new ComponentRegistry<>(),
+ (Executor)null);
}
}
diff --git a/container-search/src/main/java/com/yahoo/search/searchchain/ForkingSearcher.java b/container-search/src/main/java/com/yahoo/search/searchchain/ForkingSearcher.java
index 70cf7362c99..359c07a1875 100644
--- a/container-search/src/main/java/com/yahoo/search/searchchain/ForkingSearcher.java
+++ b/container-search/src/main/java/com/yahoo/search/searchchain/ForkingSearcher.java
@@ -1,4 +1,4 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.searchchain;
import com.yahoo.component.ComponentId;
diff --git a/container-search/src/main/java/com/yahoo/search/searchchain/FutureResult.java b/container-search/src/main/java/com/yahoo/search/searchchain/FutureResult.java
index 5f19470540f..64bbcb4780c 100644
--- a/container-search/src/main/java/com/yahoo/search/searchchain/FutureResult.java
+++ b/container-search/src/main/java/com/yahoo/search/searchchain/FutureResult.java
@@ -1,4 +1,4 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.searchchain;
import com.yahoo.search.Query;
@@ -24,7 +24,6 @@ public class FutureResult extends FutureTask<Result> {
private final Query query;
- /** Only used for generating messages */
private final Execution execution;
private final static Logger log = Logger.getLogger(FutureResult.class.getName());
@@ -90,6 +89,9 @@ public class FutureResult extends FutureTask<Result> {
return query;
}
+ /** Returns the execution which creates this */
+ public Execution getExecution() { return execution; }
+
private ErrorMessage createInterruptedError(Exception e) {
return ErrorMessage.createUnspecifiedError(execution + " was interrupted while executing: " +
Exceptions.toMessageString(e));
diff --git a/container-search/src/main/java/com/yahoo/search/searchchain/PhaseNames.java b/container-search/src/main/java/com/yahoo/search/searchchain/PhaseNames.java
index d2809e8fe33..61baf07e723 100644
--- a/container-search/src/main/java/com/yahoo/search/searchchain/PhaseNames.java
+++ b/container-search/src/main/java/com/yahoo/search/searchchain/PhaseNames.java
@@ -1,4 +1,4 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.searchchain;
/**
diff --git a/container-search/src/main/java/com/yahoo/search/searchchain/SearchChain.java b/container-search/src/main/java/com/yahoo/search/searchchain/SearchChain.java
index 35d93de64e5..bec0cc18ff8 100644
--- a/container-search/src/main/java/com/yahoo/search/searchchain/SearchChain.java
+++ b/container-search/src/main/java/com/yahoo/search/searchchain/SearchChain.java
@@ -1,4 +1,4 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.searchchain;
import com.yahoo.component.ComponentId;
diff --git a/container-search/src/main/java/com/yahoo/search/searchchain/SearchChainRegistry.java b/container-search/src/main/java/com/yahoo/search/searchchain/SearchChainRegistry.java
index 746afdb03fb..59149d3a314 100644
--- a/container-search/src/main/java/com/yahoo/search/searchchain/SearchChainRegistry.java
+++ b/container-search/src/main/java/com/yahoo/search/searchchain/SearchChainRegistry.java
@@ -1,4 +1,4 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.searchchain;
import com.yahoo.component.AbstractComponent;
diff --git a/container-search/src/main/java/com/yahoo/search/searchchain/SearcherRegistry.java b/container-search/src/main/java/com/yahoo/search/searchchain/SearcherRegistry.java
index 178fd228875..5b01d088b28 100644
--- a/container-search/src/main/java/com/yahoo/search/searchchain/SearcherRegistry.java
+++ b/container-search/src/main/java/com/yahoo/search/searchchain/SearcherRegistry.java
@@ -1,4 +1,4 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.searchchain;
import com.yahoo.component.provider.ComponentRegistry;
import com.yahoo.search.Searcher;
diff --git a/container-search/src/main/java/com/yahoo/search/searchchain/example/ExampleSearcher.java b/container-search/src/main/java/com/yahoo/search/searchchain/example/ExampleSearcher.java
index 1eb256bee44..c73edfc47a7 100644
--- a/container-search/src/main/java/com/yahoo/search/searchchain/example/ExampleSearcher.java
+++ b/container-search/src/main/java/com/yahoo/search/searchchain/example/ExampleSearcher.java
@@ -1,4 +1,4 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.searchchain.example;
import com.yahoo.search.Query;
diff --git a/container-search/src/main/java/com/yahoo/search/searchchain/model/VespaSearchers.java b/container-search/src/main/java/com/yahoo/search/searchchain/model/VespaSearchers.java
index 2f680a8f3bd..85b8a563a9e 100644
--- a/container-search/src/main/java/com/yahoo/search/searchchain/model/VespaSearchers.java
+++ b/container-search/src/main/java/com/yahoo/search/searchchain/model/VespaSearchers.java
@@ -1,4 +1,4 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.searchchain.model;
import com.yahoo.container.bundle.BundleInstantiationSpecification;
diff --git a/container-search/src/main/java/com/yahoo/search/searchchain/model/federation/FederationOptions.java b/container-search/src/main/java/com/yahoo/search/searchchain/model/federation/FederationOptions.java
index 6eeb425fc9d..57953a915b6 100644
--- a/container-search/src/main/java/com/yahoo/search/searchchain/model/federation/FederationOptions.java
+++ b/container-search/src/main/java/com/yahoo/search/searchchain/model/federation/FederationOptions.java
@@ -1,4 +1,4 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.searchchain.model.federation;
import net.jcip.annotations.Immutable;
diff --git a/container-search/src/main/java/com/yahoo/search/searchchain/model/federation/FederationSearcherModel.java b/container-search/src/main/java/com/yahoo/search/searchchain/model/federation/FederationSearcherModel.java
index 01dccee5c7f..ea8275760dc 100644
--- a/container-search/src/main/java/com/yahoo/search/searchchain/model/federation/FederationSearcherModel.java
+++ b/container-search/src/main/java/com/yahoo/search/searchchain/model/federation/FederationSearcherModel.java
@@ -1,4 +1,4 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.searchchain.model.federation;
import java.util.List;
diff --git a/container-search/src/main/java/com/yahoo/search/searchchain/model/federation/LocalProviderSpec.java b/container-search/src/main/java/com/yahoo/search/searchchain/model/federation/LocalProviderSpec.java
index 160f917f6c6..b8d6a050691 100644
--- a/container-search/src/main/java/com/yahoo/search/searchchain/model/federation/LocalProviderSpec.java
+++ b/container-search/src/main/java/com/yahoo/search/searchchain/model/federation/LocalProviderSpec.java
@@ -1,4 +1,4 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.searchchain.model.federation;
import com.google.common.collect.ImmutableList;
diff --git a/container-search/src/main/java/com/yahoo/search/searchchain/model/federation/package-info.java b/container-search/src/main/java/com/yahoo/search/searchchain/model/federation/package-info.java
index 3e449e5cbba..53b84a56a2b 100644
--- a/container-search/src/main/java/com/yahoo/search/searchchain/model/federation/package-info.java
+++ b/container-search/src/main/java/com/yahoo/search/searchchain/model/federation/package-info.java
@@ -1,4 +1,4 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
@ExportPackage
package com.yahoo.search.searchchain.model.federation;
diff --git a/container-search/src/main/java/com/yahoo/search/searchchain/model/package-info.java b/container-search/src/main/java/com/yahoo/search/searchchain/model/package-info.java
index 86feb0b036b..1d84a70ef12 100644
--- a/container-search/src/main/java/com/yahoo/search/searchchain/model/package-info.java
+++ b/container-search/src/main/java/com/yahoo/search/searchchain/model/package-info.java
@@ -1,4 +1,4 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
@ExportPackage
package com.yahoo.search.searchchain.model;
diff --git a/container-search/src/main/java/com/yahoo/search/searchchain/package-info.java b/container-search/src/main/java/com/yahoo/search/searchchain/package-info.java
index 374cdd600da..c2f6064edeb 100644
--- a/container-search/src/main/java/com/yahoo/search/searchchain/package-info.java
+++ b/container-search/src/main/java/com/yahoo/search/searchchain/package-info.java
@@ -1,4 +1,4 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
/**
* Classes for composition of searchers into search chains, which are executed to produce Results for Queries.
*/
diff --git a/container-search/src/main/java/com/yahoo/search/searchchain/testutil/DocumentSourceSearcher.java b/container-search/src/main/java/com/yahoo/search/searchchain/testutil/DocumentSourceSearcher.java
index e346a766738..e36157efddb 100644
--- a/container-search/src/main/java/com/yahoo/search/searchchain/testutil/DocumentSourceSearcher.java
+++ b/container-search/src/main/java/com/yahoo/search/searchchain/testutil/DocumentSourceSearcher.java
@@ -1,4 +1,4 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.searchchain.testutil;
@@ -38,9 +38,9 @@ public class DocumentSourceSearcher extends Searcher {
// TODO: update tests to explicitly set hits, so that the default results can be removed entirely.
private Result defaultFilledResult;
- private Map<Query, Result> completelyFilledResults = new HashMap<>();
- private Map<Query, Result> unFilledResults = new HashMap<>();
- private Map<String, Set<String>> summaryClasses = new HashMap<>();
+ private final Map<Query, Result> completelyFilledResults = new HashMap<>();
+ private final Map<Query, Result> unFilledResults = new HashMap<>();
+ private final Map<String, Set<String>> summaryClasses = new HashMap<>();
private int queryCount;