diff options
author | Jon Bratseth <bratseth@oath.com> | 2018-04-17 16:16:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-17 16:16:56 +0200 |
commit | 2dfe9539b2ba3c1b31778a68681cd5b62e0d037f (patch) | |
tree | 6c388c8b5a38ee911217523f3f2a288e0e1a1781 /container-search/src/main/java/com/yahoo/prelude/fastsearch/FastSearcher.java | |
parent | 02f822da6c0dabad91a09a896a2e3029d1d1fa1b (diff) |
Revert "Bratseth/dispatch summaries take 3"
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 | 27 |
1 files changed, 8 insertions, 19 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 e5f255f18c0..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,15 +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) - && ! 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; } @@ -357,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)); } @@ -481,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); } |