-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Improve performance for working with indices #21195
Conversation
… instead use `getForIndex(String)` directly. Also converted some loops to streaming.
Needs a changelog or /nocl directive. |
I see, thanks for the pointer! |
graylog2-server/src/main/java/org/graylog2/indexer/MongoIndexSetRegistry.java
Show resolved
Hide resolved
graylog2-server/src/test/java/org/graylog2/indexer/MongoIndexSetRegistryTest.java
Outdated
Show resolved
Hide resolved
graylog2-server/src/test/java/org/graylog2/indexer/MongoIndexSetRegistryTest.java
Outdated
Show resolved
Hide resolved
graylog2-server/src/test/java/org/graylog2/indexer/MongoIndexSetRegistryTest.java
Outdated
Show resolved
Hide resolved
graylog2-server/src/main/java/org/graylog2/indexer/MongoIndexSetRegistry.java
Show resolved
Hide resolved
graylog2-server/src/test/java/org/graylog2/indexer/MongoIndexSetRegistryTest.java
Outdated
Show resolved
Hide resolved
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.
Nice first issue - it's my pleasure to merge your first PR
Hi @bernd , can we get a backport of this fix to 6.1? Thanks! |
* Improve performance for working with indices (#21195) * Issue #18563: Don't iterate over all IndexSets for a given indexName, instead use `getForIndex(String)` directly. Also converted some loops to streaming. * Add changelog * Review comments * Review comments part two (cherry picked from commit 7845ab9) * Added PR for backport to 6.1 to the list of PR's --------- Co-authored-by: Florian Petersen <[email protected]>
Description
Don't iterate over all IndexSets for a given indexName, instead use
getForIndex(String)
directly to avoid unnecessary calls. Also converted some loops to streaming for further cleanup of the code.Motivation and Context
Fixes issue #18563.
How Has This Been Tested?
There's an new test to simulate having 500 IndexSets and checking if only the one responsible for a given specific index is being called.
Types of changes
Checklist: