diff options
author | Jo Kristian Bergum <bergum@yahoo-inc.com> | 2019-06-12 09:27:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-12 09:27:46 +0200 |
commit | 42b2fd991e077c6db563a333ace3545c43baf6bf (patch) | |
tree | cb551e3c8f9d76ae8a00b98b39cac52f27669e8d /container-search | |
parent | 4b044d83f36a296afec6778eff38f76395a36a5e (diff) | |
parent | 99cd8027a4f0f031294c3a53f10158953cb4e77b (diff) |
Merge pull request #9742 from vespa-engine/bratseth/validate-query-profiles
Holistic query profile validation
Diffstat (limited to 'container-search')
-rw-r--r-- | container-search/abi-spec.json | 1 | ||||
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/query/profile/types/QueryProfileTypeRegistry.java | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/container-search/abi-spec.json b/container-search/abi-spec.json index 80038da6750..38ce2aa2cf2 100644 --- a/container-search/abi-spec.json +++ b/container-search/abi-spec.json @@ -6177,6 +6177,7 @@ "methods": [ "public void <init>()", "public void register(com.yahoo.search.query.profile.types.QueryProfileType)", + "public boolean hasApplicationTypes()", "public void freeze()", "public static com.yahoo.search.query.profile.types.QueryProfileTypeRegistry emptyFrozen()" ], diff --git a/container-search/src/main/java/com/yahoo/search/query/profile/types/QueryProfileTypeRegistry.java b/container-search/src/main/java/com/yahoo/search/query/profile/types/QueryProfileTypeRegistry.java index ff8c4845845..b76ae88ede1 100644 --- a/container-search/src/main/java/com/yahoo/search/query/profile/types/QueryProfileTypeRegistry.java +++ b/container-search/src/main/java/com/yahoo/search/query/profile/types/QueryProfileTypeRegistry.java @@ -12,8 +12,11 @@ import com.yahoo.search.query.profile.QueryProfileRegistry; */ public class QueryProfileTypeRegistry extends ComponentRegistry<QueryProfileType> { + private final int nativeProfileCount; + public QueryProfileTypeRegistry() { Query.addNativeQueryProfileTypesTo(this); + nativeProfileCount = allComponents().size(); } /** Register this type by its id */ @@ -21,6 +24,11 @@ public class QueryProfileTypeRegistry extends ComponentRegistry<QueryProfileType super.register(type.getId(), type); } + /** Returns true if this has types in addition to the native Vespa types */ + public boolean hasApplicationTypes() { + return allComponents().size() > nativeProfileCount; + } + @Override public void freeze() { if (isFrozen()) return; |