Skip to content
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

Refactor IndicesRequestCache to make it testable. #16610

Merged
merged 1 commit into from
Feb 12, 2016

Conversation

s1monw
Copy link
Contributor

@s1monw s1monw commented Feb 11, 2016

This commit moves IndicesRequestCache into o.e.indics and makes all API in this
class package private. All references to SearchReqeust, SearchContext etc. have been factored
out and relevant glue code has been added to IndicesService. The IndicesRequestCache is not a
simple class without any hard dependencies on ThreadPool nor SearchService or IndexShard. This now
allows to add unittests.
This commit also removes two settings indices.requests.cache.clean_interval and indices.fielddata.cache.clean_interval
in favor of indices.cache.clean_interval which cleans both caches.

This commit moves IndicesRequestCache into o.e.indics and makes all API in this
class package private. All references to SearchReqeust, SearchContext etc. have been factored
out and relevant glue code has been added to IndicesService. The IndicesRequestCache is not a
simple class without any hard dependencies on ThreadPool nor SearchService or IndexShard. This now
allows to add unittests.
This commit also removes two settings `indices.requests.cache.clean_interval` and `indices.fielddata.cache.clean_interval`
in favor of `indices.cache.clean_interval` which cleans both caches.
@s1monw
Copy link
Contributor Author

s1monw commented Feb 11, 2016

@jpountz can you review that please

@jpountz
Copy link
Contributor

jpountz commented Feb 11, 2016

The change looks good.

I'm not too sure about the merge of the clean interval setting. I would rather remove this setting entirely given that it makes little sense since those caches cannot become stale.

@s1monw
Copy link
Contributor Author

s1monw commented Feb 11, 2016

I'm not too sure about the merge of the clean interval setting. I would rather remove this setting entirely given that it makes little sense since those caches cannot become stale.

you mean just have it fixed to 1 min?

@jpountz
Copy link
Contributor

jpountz commented Feb 11, 2016

Oh sorry, this setting does not do what I thought it did. I thought it would remove all entries from the cache.

LGTM then.

s1monw added a commit that referenced this pull request Feb 12, 2016
Refactor IndicesRequestCache to make it testable.
@s1monw s1monw merged commit b5aee20 into elastic:master Feb 12, 2016
@s1monw s1monw deleted the test_indices_request_cache branch February 12, 2016 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants