-
Notifications
You must be signed in to change notification settings - Fork 104
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
Percolate query optimization: Fetch fields mentioned in queries instead of entire doc and batch percolate query by heap-based threshold #1331
Draft
eirsep
wants to merge
17
commits into
opensearch-project:main
Choose a base branch
from
eirsep:percolate_per_shard
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
914ca9a
refactor doc level monitor to perform a percolate queru for docs from…
eirsep d0dd9c4
move transformedDocs into for loop in fetchDataAndExecutePercolateQue…
eirsep 58d55b2
rename percolate query execution method
eirsep b86a403
fix log messages
eirsep 6f2990f
add setting for percolate query docs size memory threshold to perform…
eirsep 92feae0
perform percolate query only if threshold setting breached or at the …
eirsep bfea7e6
change terms query clause on indices to list of should clauses as ind…
eirsep 80c64df
add setting and check on num docs in memory to determine if percolate…
eirsep 5601565
use updated index names while process findings
eirsep be29a78
register setting in plugin class
eirsep 009cd61
optimize to fetch only relevant fields from source data in doc level …
eirsep 743bda8
query shard up to max sequence number instead of just 10000
eirsep d324f8d
add stats
eirsep da6afbc
optimize on compute max seq nos and remove all redundant search requests
eirsep d7580b3
todo
eirsep ad57b56
bucket level monitor: opitmize to read only from write index when ali…
eirsep 924aed6
Merge branch 'main' of https://github.com/opensearch-project/alerting…
eirsep File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
474 changes: 363 additions & 111 deletions
474
alerting/src/main/kotlin/org/opensearch/alerting/DocumentLevelMonitorRunner.kt
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 0 additions & 14 deletions
14
alerting/src/main/kotlin/org/opensearch/alerting/model/DocumentExecutionContext.kt
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
alerting/src/main/kotlin/org/opensearch/alerting/model/IndexExecutionContext.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.alerting.model | ||
|
||
import org.opensearch.commons.alerting.model.DocLevelQuery | ||
|
||
data class IndexExecutionContext( | ||
val queries: List<DocLevelQuery>, | ||
val lastRunContext: MutableMap<String, Any>, | ||
val updatedLastRunContext: MutableMap<String, Any>, | ||
val indexName: String, | ||
val concreteIndexName: String, | ||
val conflictingFields: List<String>, | ||
val docIds: List<String>? = null | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,6 +49,9 @@ | |
}, | ||
"fields": { | ||
"type": "text" | ||
}, | ||
"query_field_names": { | ||
"type": "keyword" | ||
} | ||
} | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Minor: MEMORY -> HEAP