diff options
author | Jon Bratseth <bratseth@oath.com> | 2018-04-22 16:58:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-22 16:58:39 +0200 |
commit | 222d3d6d4a04fa441cba7f4e1e03700867f76f5c (patch) | |
tree | 6df994dba98f97e7cd89e1f2281671c192d52c0b /container-search/src/main/java/com/yahoo/prelude/fastsearch/FastSearcher.java | |
parent | 416381813ecc71079cebdfc2fbea53db50714014 (diff) |
Revert "Bratseth/dispatch summaries take 4"
Diffstat (limited to 'container-search/src/main/java/com/yahoo/prelude/fastsearch/FastSearcher.java')
-rw-r--r-- | container-search/src/main/java/com/yahoo/prelude/fastsearch/FastSearcher.java | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/container-search/src/main/java/com/yahoo/prelude/fastsearch/FastSearcher.java b/container-search/src/main/java/com/yahoo/prelude/fastsearch/FastSearcher.java index 004e01ff5fa..7d822fd603b 100644 --- a/container-search/src/main/java/com/yahoo/prelude/fastsearch/FastSearcher.java +++ b/container-search/src/main/java/com/yahoo/prelude/fastsearch/FastSearcher.java @@ -4,7 +4,6 @@ package com.yahoo.prelude.fastsearch; import java.util.Optional; import com.yahoo.compress.CompressionType; -import com.yahoo.container.search.LegacyEmulationConfig; import com.yahoo.fs4.BasicPacket; import com.yahoo.fs4.ChannelTimeoutException; import com.yahoo.fs4.GetDocSumsPacket; @@ -16,6 +15,7 @@ import com.yahoo.fs4.QueryResultPacket; import com.yahoo.fs4.mplex.Backend; import com.yahoo.fs4.mplex.FS4Channel; import com.yahoo.fs4.mplex.InvalidChannelException; +import com.yahoo.net.HostName; import com.yahoo.prelude.Ping; import com.yahoo.prelude.Pong; import com.yahoo.prelude.querytransform.QueryRewrite; @@ -56,9 +56,6 @@ public class FastSearcher extends VespaBackEndSearcher { /** If this is turned on this will make search queries directly to the local search node when possible */ private final static CompoundName dispatchDirect = new CompoundName("dispatch.direct"); - /** Unless turned off this will fill summaries by dispatching directly to search nodes over RPC when possible */ - private final static CompoundName dispatchSummaries = new CompoundName("dispatch.summaries"); - /** The compression method which will be used with rpc dispatch. "lz4" (default) and "none" is supported. */ private final static CompoundName dispatchCompression = new CompoundName("dispatch.compression"); @@ -234,7 +231,6 @@ public class FastSearcher extends VespaBackEndSearcher { /** * Only used to fill the sddocname field when using direct dispatching as that is normally done in VespaBackEndSearcher.decodeSummary - * * @param result The result */ private void fillSDDocName(Result result) { @@ -259,16 +255,11 @@ public class FastSearcher extends VespaBackEndSearcher { Query query = result.getQuery(); traceQuery(getName(), "fill", query, query.getOffset(), query.getHits(), 2, quotedSummaryClass(summaryClass)); - if (query.properties().getBoolean(dispatchSummaries, true) - && ! summaryNeedsQuery(query) - && query.getRanking().getLocation() == null - && ! cacheControl.useCache(query) - && ! legacyEmulationConfigIsSet(getDocumentDatabase(query))) { - + if (wantsRPCSummaryFill(query)) { CompressionType compression = CompressionType.valueOf(query.properties().getString(dispatchCompression, "LZ4").toUpperCase()); fillSDDocName(result); - dispatcher.fill(result, summaryClass, getDocumentDatabase(query), compression); + dispatcher.fill(result, summaryClass, compression); return; } @@ -358,14 +349,6 @@ public class FastSearcher extends VespaBackEndSearcher { } } - private boolean legacyEmulationConfigIsSet(DocumentDatabase db) { - LegacyEmulationConfig config = db.getDocsumDefinitionSet().legacyEmulationConfig(); - if (config.forceFillEmptyFields()) return true; - if (config.stringBackedFeatureData()) return true; - if (config.stringBackedStructuredData()) return true; - return false; - } - private static @NonNull Optional<String> quotedSummaryClass(String summaryClass) { return Optional.of(summaryClass == null ? "[null]" : quote(summaryClass)); } @@ -482,9 +465,14 @@ public class FastSearcher extends VespaBackEndSearcher { } boolean couldSend = channel.sendPacket(docsumsPacket); + if (isLoggingFine()) + getLogger().finest("Sent " + docsumsPacket + " on " + channel); if ( ! couldSend) throw new IOException("Could not successfully send GetDocSumsPacket."); receivedPackets = channel.receivePackets(result.getQuery().getTimeLeft(), docsumsPacket.getNumDocsums() + 1); + if (isLoggingFine()) + getLogger().finest("got " + receivedPackets.length + "docsumPackets"); + return convertBasicPackets(receivedPackets); } |