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

Caching index settings #100

Merged
merged 3 commits into from
Mar 7, 2024
Merged

Caching index settings #100

merged 3 commits into from
Mar 7, 2024

Conversation

jzonthemtn
Copy link
Collaborator

For #92, cache index settings to avoid looking at the index to find the settings. This is to avoid unnecessary roundtrips when logging queries.

Upon first query, the settings are retrieved from the index. For queries after that, the setting is retrieved from the cache:

opensearch_ubi  | [2024-03-07T18:22:47,815][INFO ][o.o.u.a.UserBehaviorInsightsActionFilter] [opensearch] Getting setting index.ubi.store for store awesome from the cache.
opensearch_ubi  | [2024-03-07T18:22:47,816][INFO ][o.o.u.a.UserBehaviorInsightsActionFilter] [opensearch] Getting setting index.ubi.id_field for store awesome from the cache.

After the store is deleted and recreated, the next search will get the settings from the index since the cache has been cleared.

opensearch_ubi  | [2024-03-07T18:23:25,851][INFO ][o.o.u.a.UserBehaviorInsightsActionFilter] [opensearch] Getting setting index.ubi.store for store awesome from the index.
opensearch_ubi  | [2024-03-07T18:23:25,853][INFO ][o.o.u.a.UserBehaviorInsightsActionFilter] [opensearch] Getting setting index.ubi.id_field for store awesome from the index.

Copy link
Member

@epugh epugh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense that we look this up....

import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.*;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is * a normal pattern in OPenSearch? (would not be in Solr!)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, but I don't like it either. Will update.

Copy link
Collaborator Author

@jzonthemtn jzonthemtn Mar 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turned out to be several instances of it so I fixed them all. There's a setting in IntelliJ to not let it do that to imports.

@epugh
Copy link
Member

epugh commented Mar 7, 2024

@jzonthemtn looks good except one import nit?

@epugh epugh merged commit 98fdff2 into main Mar 7, 2024
1 check passed
@jzonthemtn jzonthemtn deleted the cache_settings branch March 7, 2024 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants