New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Percolator should cache index field data instances. #7081
Percolator should cache index field data instances. #7081
Conversation
@@ -188,11 +188,7 @@ public Filter cacheFilter(Filter filter, @Nullable CacheKeyFilter.Key cacheKey) | |||
} | |||
|
|||
public <IFD extends IndexFieldData<?>> IFD getForField(FieldMapper<?> mapper) { | |||
if (disableCaching) { | |||
return indexQueryParser.fieldDataService.getForFieldDirect(mapper); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove this method now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think getForField
can stay? Because it is shorter, otherwise all code needs to do context.fielddata() and then invoke getForField()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I wanted to remove getForFieldDirect, not getForField
The change looks good to me. Should we add assertions in the percolation tests to ensure that the field data cache is empty at the end of tests? |
@jpountz Good idea, but should this be a general check? (Like how we check the circuit breaker after each test) |
@martijnvg Probably! |
@jpountz I updated the PR to check if the filter cache and field data cache is 0 before stopping the test cluster. |
LGTM |
Before the index reader used by the percolator didn't allow to register a CoreCloseListener, but now it does, making it safe to cache index field data cache entries. Creating field data structures is relatively expensive and caching them can save a lot of noise if many queries are evaluated in a percolator call. Closes elastic#6806 Closes elastic#7081
Before the index reader used by the percolator didn't allow to register a CoreCloseListener, but now it does, making it safe to cache index field data cache entries. Creating field data structures is relatively expensive and caching them can save a lot of noise if many queries are evaluated in a percolator call. Closes #6806 Closes #7081
Before the index reader used by the percolator didn't allow to register a CoreCloseListener, but now it does, making it safe to cache index field data cache entries. Creating field data structures is relatively expensive and caching them can save a lot of noise if many queries are evaluated in a percolator call. Closes #6806 Closes #7081
Before the index reader used by the percolator didn't allow to register a CoreCloseListener, but now it does, making it safe to cache index field data cache entries. Creating field data structures is relatively expensive and caching them can save a lot of noise if many queries are evaluated in a percolator call. Closes #6806 Closes #7081
Before the index reader used by the percolator didn't allow to register a CoreCloseListener, but now it does, making it safe to cache index field data cache entries. Creating field data structures is relatively expensive and caching them can save a lot of noise if many queries are evaluated in a percolator call. Closes elastic#6806 Closes elastic#7081
Before the index reader used by the percolator didn't allow to register a CoreCloseListener, but now it does, making it safe to cache index field data cache entries.
Creating field data structures is relatively expensive and caching them can save a lot of noise if many queries are evaluated in a percolator call.
Closes #6806