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

Add a periodic cleanup thread for IndexFieldCache caches #7015

Merged
merged 1 commit into from Jul 24, 2014

Conversation

Projects
None yet
3 participants
@dakrone
Copy link
Member

dakrone commented Jul 24, 2014

Defaults to every 10 minutes.

Fixes #7010

@dakrone dakrone added v1.4.0 labels Jul 24, 2014

@kimchy

View changes

src/main/java/org/elasticsearch/indices/fielddata/cache/IndicesFieldDataCache.java Outdated
try {
// Each key in the cache contains an IndexFieldCache, so clean
// up each of the entries' caches
for (Key key : cache.asMap().keySet()) {

This comment has been minimized.

Copy link
@kimchy

kimchy Jul 24, 2014

Member

isn't Key#indexCache simply the same cache instance that we create on construction of IndicesFieldDataCache? We can just call cleanup once on the cache class, and then we are good?

This comment has been minimized.

Copy link
@dakrone

dakrone Jul 24, 2014

Author Member

Ahh yea, I missed that it was threaded through and not a brand new cache, will fix.


@Override
public void run() {
long startTime = System.currentTimeMillis();

This comment has been minimized.

Copy link
@kimchy

kimchy Jul 24, 2014

Member

can we add a close flag on this class, and mark it as closed when this class "closes", so we will stop rescheduling the cleanup task?

This comment has been minimized.

Copy link
@dakrone

dakrone Jul 24, 2014

Author Member

Yep, added this.

@kimchy

This comment has been minimized.

Copy link
Member

kimchy commented Jul 24, 2014

LGTM, I wonder if we should be more aggressive with the interval? I think something like 60 seconds, specifically since it doesn't spawn another thread, would work well

@dakrone dakrone added enhancement and removed review labels Jul 24, 2014

@dakrone

This comment has been minimized.

Copy link
Member Author

dakrone commented Jul 24, 2014

Changing the interval to 1 minute.

@kimchy

This comment has been minimized.

Copy link
Member

kimchy commented Jul 24, 2014

LGTM

@dakrone dakrone merged commit 89e0391 into elastic:master Jul 24, 2014

@clintongormley clintongormley changed the title Add a periodic cleanup thread for IndexFieldCache caches Internal: Add a periodic cleanup thread for IndexFieldCache caches Sep 8, 2014

@dakrone dakrone deleted the dakrone:add-cache-cleanup-thread branch Sep 9, 2014

@clintongormley clintongormley changed the title Internal: Add a periodic cleanup thread for IndexFieldCache caches Add a periodic cleanup thread for IndexFieldCache caches Jun 7, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.