diff options
Diffstat (limited to 'container-search/src')
14 files changed, 6 insertions, 244 deletions
diff --git a/container-search/src/main/java/com/yahoo/prelude/IndexModel.java b/container-search/src/main/java/com/yahoo/prelude/IndexModel.java index 57a8d518ed2..64d747b7b98 100644 --- a/container-search/src/main/java/com/yahoo/prelude/IndexModel.java +++ b/container-search/src/main/java/com/yahoo/prelude/IndexModel.java @@ -39,20 +39,6 @@ public final class IndexModel { this.unionSearchDefinition = unionOf(searchDefinitions); } - /** - * Use IndexModel as a pure wrapper for the parameters given. - * - * @deprecated use the constructor without the third parameter - */ - @Deprecated // TODO: Remove Vespa 8 - public IndexModel(Map<String, List<String>> masterClusters, - Map<String, SearchDefinition> searchDefinitions, - SearchDefinition unionSearchDefinition) { - this.masterClusters = masterClusters; - this.searchDefinitions = searchDefinitions; - this.unionSearchDefinition = unionSearchDefinition; - } - public IndexModel(IndexInfoConfig indexInfo, QrSearchersConfig clusters) { this(indexInfo, toClusters(clusters)); } @@ -135,8 +121,6 @@ public final class IndexModel { public Map<String, SearchDefinition> getSearchDefinitions() { return searchDefinitions; } - /** @deprecated do not use */ - @Deprecated // TODO: Remove on Vespa 8 - public SearchDefinition getUnionSearchDefinition() { return unionSearchDefinition; } + SearchDefinition getUnionSearchDefinition() { return unionSearchDefinition; } } diff --git a/container-search/src/main/java/com/yahoo/prelude/query/QueryException.java b/container-search/src/main/java/com/yahoo/prelude/query/QueryException.java deleted file mode 100644 index 60aab75f219..00000000000 --- a/container-search/src/main/java/com/yahoo/prelude/query/QueryException.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.prelude.query; - -/** - * Runtime exception to mark errors in query parsing. - * - * @author Steinar Knutsen - * @deprecated no methods throw this - */ -@Deprecated // TODO: Remove on Vespa 8 -public class QueryException extends RuntimeException { - - public QueryException(String message) { - super(message); - } - - public QueryException(String message, Throwable cause) { - super(message, cause); - } - -} diff --git a/container-search/src/main/java/com/yahoo/prelude/query/WeakAndItem.java b/container-search/src/main/java/com/yahoo/prelude/query/WeakAndItem.java index 5ffd4d1584d..859973f3b78 100644 --- a/container-search/src/main/java/com/yahoo/prelude/query/WeakAndItem.java +++ b/container-search/src/main/java/com/yahoo/prelude/query/WeakAndItem.java @@ -24,7 +24,6 @@ public final class WeakAndItem extends NonReducibleCompositeItem { private int n; private String index; - private int scoreThreshold = 0; /** Creates a WAND item with default N */ public WeakAndItem() { @@ -81,17 +80,6 @@ public final class WeakAndItem extends NonReducibleCompositeItem { public void setN(int N) { this.n = N; } - @Deprecated // TODO: Remove on Vespa 8 - public int getScoreThreshold() { return scoreThreshold; } - - /** - * Noop. - * - * @deprecated has no effect - */ - @Deprecated // TODO: Remove on Vespa 8 - public void setScoreThreshold(int scoreThreshold) { this.scoreThreshold = scoreThreshold; } - @Override protected void encodeThis(ByteBuffer buffer) { super.encodeThis(buffer); diff --git a/container-search/src/main/java/com/yahoo/search/Query.java b/container-search/src/main/java/com/yahoo/search/Query.java index 5e46815a152..a6d87426126 100644 --- a/container-search/src/main/java/com/yahoo/search/Query.java +++ b/container-search/src/main/java/com/yahoo/search/Query.java @@ -4,18 +4,12 @@ package com.yahoo.search; import ai.vespa.cloud.ZoneInfo; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import com.yahoo.collections.Tuple2; -import com.yahoo.component.Version; import com.yahoo.container.jdisc.HttpRequest; -import com.yahoo.fs4.MapEncoder; import com.yahoo.language.process.Embedder; -import com.yahoo.prelude.fastsearch.DocumentDatabase; -import com.yahoo.prelude.query.Highlight; import com.yahoo.prelude.query.textualrepresentation.TextualQueryRepresentation; import com.yahoo.processing.request.CompoundName; import com.yahoo.search.schema.SchemaInfo; import com.yahoo.search.dispatch.Dispatcher; -import com.yahoo.search.dispatch.rpc.ProtobufSerialization; import com.yahoo.search.federation.FederationSearcher; import com.yahoo.search.query.Model; import com.yahoo.search.query.ParameterParser; @@ -858,12 +852,6 @@ public class Query extends com.yahoo.processing.Request implements Cloneable { } } - /** @deprecated remove the ignored segmenterVersion argument from invocations */ - @Deprecated // TODO: Remove on Vespa 8 - public String yqlRepresentation(Tuple2<String, Version> segmenterVersion, boolean includeHitsAndOffset) { - return yqlRepresentation(includeHitsAndOffset); - } - /** * Serialize this query as YQL+. This will create a string representation * which should always be legal YQL+. If a problem occurs, a @@ -1061,73 +1049,6 @@ public class Query extends com.yahoo.processing.Request implements Cloneable { return new SessionId(requestId, getRanking().getProfile()); } - @Deprecated // TODO: Remove on Vespa 8 - public boolean hasEncodableProperties() { - if ( ! ranking.getProperties().isEmpty()) return true; - if ( ! ranking.getFeatures().isEmpty()) return true; - if ( ranking.getFreshness() != null) return true; - if ( model.getSearchPath() != null) return true; - if ( model.getDocumentDb() != null) return true; - if ( presentation.getHighlight() != null && ! presentation.getHighlight().getHighlightItems().isEmpty()) return true; - return false; - } - - /** - * Encodes properties of this query. - * - * @param buffer the buffer to encode to - * @param encodeQueryData true to encode all properties, false to only include session information, not actual query data - * @return the encoded length - * @deprecated do not use - */ - @Deprecated // TODO: Remove on Vespa 8 - public int encodeAsProperties(ByteBuffer buffer, boolean encodeQueryData) { - // Make sure we don't encode anything here if we have turned the property feature off - // Due to sendQuery we sometimes end up turning this feature on and then encoding a 0 int as the number of - // property maps - that's ok (probably we should simplify by just always turning the feature on) - if (! hasEncodableProperties()) return 0; - int start = buffer.position(); - int mapCountPosition = buffer.position(); - buffer.putInt(0); // map count will go here - int mapCount = 0; - mapCount += ranking.getProperties().encode(buffer, encodeQueryData); - if (encodeQueryData) { - mapCount += ranking.getFeatures().encode(buffer); - if (presentation.getHighlight() != null) { - mapCount += MapEncoder.encodeMultiMap(Highlight.HIGHLIGHTTERMS, presentation.getHighlight().getHighlightTerms(), buffer); - } - mapCount += MapEncoder.encodeMap("model", createModelMap(), buffer); - } - mapCount += MapEncoder.encodeSingleValue(DocumentDatabase.MATCH_PROPERTY, DocumentDatabase.SEARCH_DOC_TYPE_KEY, model.getDocumentDb(), buffer); - mapCount += MapEncoder.encodeMap("caches", createCacheSettingMap(), buffer); - buffer.putInt(mapCountPosition, mapCount); - return buffer.position() - start; - } - - private Map<String, Boolean> createCacheSettingMap() { - if (getGroupingSessionCache() && ranking.getQueryCache()) { - Map<String, Boolean> cacheSettingMap = new HashMap<>(); - cacheSettingMap.put("grouping", true); - cacheSettingMap.put("query", true); - return cacheSettingMap; - } - if (getGroupingSessionCache()) - return Collections.singletonMap("grouping", true); - if (ranking.getQueryCache()) - return Collections.singletonMap("query", true); - return Collections.emptyMap(); - } - - private Map<String, String> createModelMap() { - Map<String, String> m = new HashMap<>(); - if (model.getSearchPath() != null) m.put("searchpath", model.getSearchPath()); - - int traceLevel = ProtobufSerialization.getTraceLevelForBackend(this); - if (traceLevel > 0) m.put("tracelevel", String.valueOf(traceLevel)); - - return m; - } - /** * Prepares this for binary serialization. * diff --git a/container-search/src/main/java/com/yahoo/search/cluster/BaseNodeMonitor.java b/container-search/src/main/java/com/yahoo/search/cluster/BaseNodeMonitor.java index 48bfd4c9b66..fd8110e1173 100644 --- a/container-search/src/main/java/com/yahoo/search/cluster/BaseNodeMonitor.java +++ b/container-search/src/main/java/com/yahoo/search/cluster/BaseNodeMonitor.java @@ -58,10 +58,6 @@ public abstract class BaseNodeMonitor<T> { */ public boolean isWorking() { return isWorking; } - /** @deprecated Not used */ - @Deprecated // TODO: Remove on Vespa 8 - public boolean isQuarantined() { return isQuarantined; } - /** * Called when this node fails. * @@ -79,12 +75,6 @@ public abstract class BaseNodeMonitor<T> { */ public abstract void responded(); - /** @deprecated Not used */ - @Deprecated // TODO: Remove on Vespa 8 - public boolean isIdle() { - return (now()-respondedAt) >= configuration.getIdleLimit(); - } - protected long now() { return System.currentTimeMillis(); } diff --git a/container-search/src/main/java/com/yahoo/search/cluster/ClusterMonitor.java b/container-search/src/main/java/com/yahoo/search/cluster/ClusterMonitor.java index 360dcd38d3b..4bb1818e5d1 100644 --- a/container-search/src/main/java/com/yahoo/search/cluster/ClusterMonitor.java +++ b/container-search/src/main/java/com/yahoo/search/cluster/ClusterMonitor.java @@ -79,15 +79,6 @@ public class ClusterMonitor<T> { nodeMonitors.put(node, new TrafficNodeMonitor<>(node, configuration, internal)); } - /** - * Returns the monitor of the given node, or null if this node has not been added - * @deprecated Will be removed in Vespa 8. - */ - @Deprecated(forRemoval = true, since = "7.537") - public BaseNodeMonitor<T> getNodeMonitor(T node) { - return nodeMonitors.get(node); - } - /** Called from ClusterSearcher/NodeManager when a node failed */ public synchronized void failed(T node, ErrorMessage error) { if (closed.get()) return; // Do not touch state if close has started. diff --git a/container-search/src/main/java/com/yahoo/search/cluster/MonitorConfiguration.java b/container-search/src/main/java/com/yahoo/search/cluster/MonitorConfiguration.java index c421e9dbe69..9960f7f4b74 100644 --- a/container-search/src/main/java/com/yahoo/search/cluster/MonitorConfiguration.java +++ b/container-search/src/main/java/com/yahoo/search/cluster/MonitorConfiguration.java @@ -17,77 +17,21 @@ public class MonitorConfiguration { /** The number of milliseconds a node is allowed to fail before we mark it as not working */ private long failLimit = 5000; - /** Sets the interval between each ping of idle or failing nodes. Default is 1000 ms. */ - @Deprecated // TODO: Remove on Vespa 8 - public void setCheckInterval(long intervalMs) { this.checkInterval = intervalMs; } - /** Returns the interval between each ping of idle or failing nodes. Default is 1000 ms. */ public long getCheckInterval() { return checkInterval; } /** - * Sets the number of times a failed node must respond before it is put back in service. Default is 3. - * - * @deprecated will go away in Vespa 8 - */ - @Deprecated // TODO: Remove on Vespa 8 - public void setResponseAfterFailLimit(int responseAfterFailLimit) { } - - /** - * Sets the number of ms a node (failing or working) is allowed to stay idle before it is pinged. Default is 3000. - * - * @deprecated Will go away in Vespa 8 - */ - @Deprecated // TODO: Remove on Vespa 8 - public void setIdleLimit(int idleLimit) { } - - /** - * Gets the number of ms a node (failing or working) is allowed to stay idle before it is pinged. Default is 3000. - * - * @deprecated Will go away in Vespa 8 - */ - @Deprecated // TODO: Remove on Vespa 8 - public long getIdleLimit() { - return 3000; - } - - /** * Returns the number of milliseconds to attempt to service a request * (at different nodes) before giving up. Default is 5000 ms. */ public long getRequestTimeout() { return requestTimeout; } /** - * Sets the number of milliseconds a node is allowed to fail before we - * mark it as not working - */ - @Deprecated // TODO: Remove on Vespa 8 - public void setFailLimit(long failLimit) { this.failLimit=failLimit; } - - /** * Returns the number of milliseconds a node is allowed to fail before we * mark it as not working */ public long getFailLimit() { return failLimit; } - /** - * The number of times a node must fail in one hour to be placed - * in quarantine. Once in quarantine it won't be put back in - * productuion before quarantineTime has expired even if it is - * working. Default is 3 - * - * @deprecated Will go away in Vespa 8 - */ - @Deprecated // TODO: Remove on Vespa 8 - public void setFailQuarantineLimit(int failQuarantineLimit) { } - - /** - * The number of ms an unstable node is quarantined. Default is 100*60*60 - * - * @deprecated Will go away in Vespa 8 - */ - @Deprecated // TODO: Remove on Vespa 8 - public void setQuarantineTime(long quarantineTime) { } - @Override public String toString() { return "monitor configuration [" + diff --git a/container-search/src/main/java/com/yahoo/search/cluster/NodeManager.java b/container-search/src/main/java/com/yahoo/search/cluster/NodeManager.java index db583a65606..c4a532bdb03 100644 --- a/container-search/src/main/java/com/yahoo/search/cluster/NodeManager.java +++ b/container-search/src/main/java/com/yahoo/search/cluster/NodeManager.java @@ -20,25 +20,12 @@ public interface NodeManager<T> { /** Called when a working node fails */ void failed(T node); - /** - * Called when a node should be pinged. - * This *must* lead to either a call to NodeMonitor.failed or NodeMonitor.responded - * - * @deprecated Use ping(ClusterMonitor clusterMonitor, T node, Executor executor) instead. - */ - @Deprecated // TODO: Remove on Vespa 8 - default void ping(T node, Executor executor) { - throw new IllegalStateException("If you have not overrriden ping(ClusterMonitor<T> clusterMonitor, T node, Executor executor), you should at least have overriden this method."); - } - /** * Called when a node should be pinged. * This *must* lead to either a call to ClusterMonitor.failed or ClusterMonitor.responded */ - default void ping(ClusterMonitor<T> clusterMonitor, T node, Executor executor) { - ping(node, executor); - } - + void ping(ClusterMonitor<T> clusterMonitor, T node, Executor executor); + /** Called right after a ping has been issued to each node. This default implementation does nothing. */ default void pingIterationCompleted() {} diff --git a/container-search/src/main/java/com/yahoo/search/query/SelectParser.java b/container-search/src/main/java/com/yahoo/search/query/SelectParser.java index ccf24a13f34..e8ea6f88fce 100644 --- a/container-search/src/main/java/com/yahoo/search/query/SelectParser.java +++ b/container-search/src/main/java/com/yahoo/search/query/SelectParser.java @@ -519,9 +519,6 @@ public class SelectParser implements Parser { if (TARGET_NUM_HITS.equals(annotation_name)) { weakAnd.setN((int)(annotation_value.asDouble())); } - if (SCORE_THRESHOLD.equals(annotation_name)) { - weakAnd.setScoreThreshold((int)(annotation_value.asDouble())); - } }); } diff --git a/container-search/src/main/java/com/yahoo/search/yql/VespaSerializer.java b/container-search/src/main/java/com/yahoo/search/yql/VespaSerializer.java index 194863e3129..96f86354ba5 100644 --- a/container-search/src/main/java/com/yahoo/search/yql/VespaSerializer.java +++ b/container-search/src/main/java/com/yahoo/search/yql/VespaSerializer.java @@ -1042,7 +1042,7 @@ public class VespaSerializer { } private boolean needsAnnotationBlock(WeakAndItem item) { - return nonDefaultScoreThreshold(item) || nonDefaultTargetNumHits(item); + return nonDefaultTargetNumHits(item); } @Override @@ -1050,14 +1050,9 @@ public class VespaSerializer { if (needsAnnotationBlock(item)) { destination.append("([{"); } - int lengthBeforeAnnotations = destination.length(); if (nonDefaultTargetNumHits(item)) { destination.append(TARGET_NUM_HITS).append(": ").append(item.getN()); } - if (nonDefaultScoreThreshold(item)) { - comma(destination, lengthBeforeAnnotations); - destination.append(SCORE_THRESHOLD).append(": ").append(item.getScoreThreshold()); - } if (needsAnnotationBlock(item)) { destination.append("}]"); } @@ -1065,10 +1060,6 @@ public class VespaSerializer { return true; } - private boolean nonDefaultScoreThreshold(WeakAndItem w) { - return w.getScoreThreshold() > 0; - } - private boolean nonDefaultTargetNumHits(WeakAndItem w) { return w.getN() != WeakAndItem.defaultN; } diff --git a/container-search/src/main/java/com/yahoo/search/yql/YqlParser.java b/container-search/src/main/java/com/yahoo/search/yql/YqlParser.java index 19d4e6d41ba..15e3b7aab14 100644 --- a/container-search/src/main/java/com/yahoo/search/yql/YqlParser.java +++ b/container-search/src/main/java/com/yahoo/search/yql/YqlParser.java @@ -1139,11 +1139,6 @@ public class YqlParser implements Parser { if (targetNumHits != null) { weakAnd.setN(targetNumHits); } - Integer scoreThreshold = getAnnotation(spec, SCORE_THRESHOLD, - Integer.class, null, "min dot product score for hit inclusion"); - if (scoreThreshold != null) { - weakAnd.setScoreThreshold(scoreThreshold); - } return convertVarArgs(spec, 1, weakAnd); } diff --git a/container-search/src/test/java/com/yahoo/search/yql/VespaSerializerTestCase.java b/container-search/src/test/java/com/yahoo/search/yql/VespaSerializerTestCase.java index 8a90d224003..5c37f590619 100644 --- a/container-search/src/test/java/com/yahoo/search/yql/VespaSerializerTestCase.java +++ b/container-search/src/test/java/com/yahoo/search/yql/VespaSerializerTestCase.java @@ -297,9 +297,6 @@ public class VespaSerializerTestCase { @Test public void testAnnotatedWeakAnd() { parseAndConfirm("([{" + YqlParser.TARGET_NUM_HITS + ": 10}]weakAnd(a contains \"A\", b contains \"B\"))"); - parseAndConfirm("([{" + YqlParser.SCORE_THRESHOLD + ": 10}]weakAnd(a contains \"A\", b contains \"B\"))"); - parseAndConfirm("([{" + YqlParser.TARGET_NUM_HITS + ": 10, " + YqlParser.SCORE_THRESHOLD - + ": 20}]weakAnd(a contains \"A\", b contains \"B\"))"); } @Test diff --git a/container-search/src/test/java/com/yahoo/search/yql/YqlParserTestCase.java b/container-search/src/test/java/com/yahoo/search/yql/YqlParserTestCase.java index 93b0ea60de2..4e92b603835 100644 --- a/container-search/src/test/java/com/yahoo/search/yql/YqlParserTestCase.java +++ b/container-search/src/test/java/com/yahoo/search/yql/YqlParserTestCase.java @@ -705,11 +705,10 @@ public class YqlParserTestCase { "b contains \"B\")", "WEAKAND(37) a:A b:B"); - QueryTree tree = parse("select foo from bar where {scoreThreshold: 41}weakAnd(a " + + QueryTree tree = parse("select foo from bar where weakAnd(a " + "contains \"A\", b contains \"B\")"); assertEquals("WEAKAND(100) a:A b:B", tree.toString()); assertEquals(WeakAndItem.class, tree.getRoot().getClass()); - assertEquals(41, ((WeakAndItem)tree.getRoot()).getScoreThreshold()); } @Test diff --git a/container-search/src/test/java/com/yahoo/select/SelectTestCase.java b/container-search/src/test/java/com/yahoo/select/SelectTestCase.java index 9b867be1484..8ede243d3ca 100644 --- a/container-search/src/test/java/com/yahoo/select/SelectTestCase.java +++ b/container-search/src/test/java/com/yahoo/select/SelectTestCase.java @@ -560,10 +560,9 @@ public class SelectTestCase { assertParse("{ \"weakAnd\": { \"children\" : [{ \"contains\": [\"a\", \"A\"] }, { \"contains\": [\"b\", \"B\"] } ], \"attributes\" : {\"targetHits\": 37} }}", "WEAKAND(37) a:A b:B"); - QueryTree tree = parseWhere("{ \"weakAnd\": { \"children\" : [{ \"contains\": [\"a\", \"A\"] }, { \"contains\": [\"b\", \"B\"] } ], \"attributes\" : {\"scoreThreshold\": 41}}}"); + QueryTree tree = parseWhere("{ \"weakAnd\": { \"children\" : [{ \"contains\": [\"a\", \"A\"] }, { \"contains\": [\"b\", \"B\"] } ] }}"); assertEquals("WEAKAND(100) a:A b:B", tree.toString()); assertEquals(WeakAndItem.class, tree.getRoot().getClass()); - assertEquals(41, ((WeakAndItem)tree.getRoot()).getScoreThreshold()); } @Test |