diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2023-03-30 09:30:49 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2023-03-30 10:23:38 +0200 |
commit | e7d6baa6981edceff032b2d685d70b76c476828e (patch) | |
tree | 0a2bb7fc25591f3b62cddccbc7afb4ca9a51aa9e /container-search/src/main | |
parent | 904eac185da61419c9c7e244835c1704c318c134 (diff) |
Propagate the configured slime decode type into the rpc summary handling.
Diffstat (limited to 'container-search/src/main')
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/dispatch/rpc/RpcInvokerFactory.java | 12 | ||||
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/dispatch/rpc/RpcProtobufFillInvoker.java | 5 |
2 files changed, 15 insertions, 2 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/dispatch/rpc/RpcInvokerFactory.java b/container-search/src/main/java/com/yahoo/search/dispatch/rpc/RpcInvokerFactory.java index 4466b03a713..154002c4f77 100644 --- a/container-search/src/main/java/com/yahoo/search/dispatch/rpc/RpcInvokerFactory.java +++ b/container-search/src/main/java/com/yahoo/search/dispatch/rpc/RpcInvokerFactory.java @@ -20,11 +20,20 @@ public class RpcInvokerFactory extends InvokerFactory { private final RpcConnectionPool rpcResourcePool; private final CompressPayload compressor; + private final RpcProtobufFillInvoker.DecodePolicy decodeType; + + private static RpcProtobufFillInvoker.DecodePolicy convert(DispatchConfig.SummaryDecodePolicy.Enum decoding) { + return switch (decoding) { + case EAGER -> RpcProtobufFillInvoker.DecodePolicy.EAGER; + case ONDEMAND -> RpcProtobufFillInvoker.DecodePolicy.ONDEMAND; + }; + } public RpcInvokerFactory(RpcConnectionPool rpcResourcePool, SearchGroups cluster, DispatchConfig dispatchConfig) { super(cluster, dispatchConfig); this.rpcResourcePool = rpcResourcePool; this.compressor = new CompressService(); + decodeType = convert(dispatchConfig.summaryDecodePolicy()); } @Override @@ -37,6 +46,7 @@ public class RpcInvokerFactory extends InvokerFactory { Query query = result.getQuery(); boolean summaryNeedsQuery = searcher.summaryNeedsQuery(query); - return new RpcProtobufFillInvoker(rpcResourcePool, compressor, searcher.getDocumentDatabase(query), searcher.getServerId(), summaryNeedsQuery); + return new RpcProtobufFillInvoker(rpcResourcePool, compressor, searcher.getDocumentDatabase(query), + searcher.getServerId(), decodeType, summaryNeedsQuery); } } diff --git a/container-search/src/main/java/com/yahoo/search/dispatch/rpc/RpcProtobufFillInvoker.java b/container-search/src/main/java/com/yahoo/search/dispatch/rpc/RpcProtobufFillInvoker.java index 4e538fb54dc..8ffeecd71a8 100644 --- a/container-search/src/main/java/com/yahoo/search/dispatch/rpc/RpcProtobufFillInvoker.java +++ b/container-search/src/main/java/com/yahoo/search/dispatch/rpc/RpcProtobufFillInvoker.java @@ -42,6 +42,8 @@ public class RpcProtobufFillInvoker extends FillInvoker { private static final Logger log = Logger.getLogger(RpcProtobufFillInvoker.class.getName()); + enum DecodePolicy {EAGER, ONDEMAND} + private final DocumentDatabase documentDb; private final RpcConnectionPool resourcePool; private final boolean summaryNeedsQuery; @@ -56,7 +58,8 @@ public class RpcProtobufFillInvoker extends FillInvoker { /** The number of responses we should receive (and process) before this is complete */ private int outstandingResponses; - RpcProtobufFillInvoker(RpcConnectionPool resourcePool, CompressPayload compressor, DocumentDatabase documentDb, String serverId, boolean summaryNeedsQuery) { + RpcProtobufFillInvoker(RpcConnectionPool resourcePool, CompressPayload compressor, DocumentDatabase documentDb, + String serverId, DecodePolicy decodePolicy, boolean summaryNeedsQuery) { this.documentDb = documentDb; this.resourcePool = resourcePool; this.serverId = serverId; |