summaryrefslogtreecommitdiffstats
path: root/container-search
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-06-27 11:03:34 +0200
committerGitHub <noreply@github.com>2022-06-27 11:03:34 +0200
commit9a585240e6ab514ffb10f9fc99af8fef8c5bd59d (patch)
tree2c825e4eb941ec0d36711103929b963f6fe95bcf /container-search
parent97feac76549148fbe18743723c3e2d443060fece (diff)
parent4894b51f0fe6566883886c9aeed65a45c56dab96 (diff)
Merge pull request #23238 from vespa-engine/balder/use-fixed-map-if-context-is-empty
If the context map is empty just return the default
Diffstat (limited to 'container-search')
-rw-r--r--container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileProperties.java2
-rw-r--r--container-search/src/main/java/com/yahoo/search/query/properties/PropertyMap.java3
-rw-r--r--container-search/src/main/java/com/yahoo/search/query/properties/RequestContextProperties.java2
3 files changed, 3 insertions, 4 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileProperties.java b/container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileProperties.java
index 3f9df4d9955..7f5df94d020 100644
--- a/container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileProperties.java
+++ b/container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileProperties.java
@@ -298,7 +298,7 @@ public class QueryProfileProperties extends Properties {
private Map<String, String> contextWithZoneInfo(Map<String, String> context) {
if (zoneInfo == ZoneInfo.defaultInfo()) return context;
- if (context == null) return zoneContext;
+ if (context == null || context.isEmpty()) return zoneContext;
if (context == zoneContext) return context;
if (context.containsKey(ENVIRONMENT) && context.containsKey(REGION) && context.containsKey(INSTANCE)) return context;
diff --git a/container-search/src/main/java/com/yahoo/search/query/properties/PropertyMap.java b/container-search/src/main/java/com/yahoo/search/query/properties/PropertyMap.java
index 72388f77173..f60d9820706 100644
--- a/container-search/src/main/java/com/yahoo/search/query/properties/PropertyMap.java
+++ b/container-search/src/main/java/com/yahoo/search/query/properties/PropertyMap.java
@@ -1,6 +1,7 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
package com.yahoo.search.query.properties;
-import com.yahoo.processing.request.*;
+import com.yahoo.processing.request.CompoundName;
import com.yahoo.search.query.Properties;
import java.util.Map;
import java.util.LinkedHashMap;
diff --git a/container-search/src/main/java/com/yahoo/search/query/properties/RequestContextProperties.java b/container-search/src/main/java/com/yahoo/search/query/properties/RequestContextProperties.java
index ad212d05780..0ac61246c48 100644
--- a/container-search/src/main/java/com/yahoo/search/query/properties/RequestContextProperties.java
+++ b/container-search/src/main/java/com/yahoo/search/query/properties/RequestContextProperties.java
@@ -1,12 +1,10 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.query.properties;
-import ai.vespa.cloud.ZoneInfo;
import com.yahoo.processing.request.CompoundName;
import com.yahoo.search.query.Properties;
import java.util.Collections;
-import java.util.HashMap;
import java.util.Map;
/**