-
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
doc-level monitor fan-out approach #1496
Merged
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
2c7486b
doc-level monitor fan-out approach
sbcd90 3ee0f10
doc-level monitor fan-out approach
sbcd90 be420ab
doc-level monitor fan-out approach
sbcd90 116fe90
doc-level monitor fan-out approach
sbcd90 0588456
doc-level monitor fan-out approach
sbcd90 9250a7d
doc-level monitor fan-out approach
sbcd90 6586a10
doc-level monitor fan-out approach
sbcd90 22459a7
doc-level monitor fan-out approach
sbcd90 e4b7310
doc-level monitor fan-out approach
sbcd90 9008367
fix review comments
sbcd90 49b2374
fix retry issue
sbcd90 9d38e26
Merge branch 'main' into test67
sbcd90 600519e
fix for fan-out failure scenarios
sbcd90 fd5c3e5
Merge branch 'main' into test67
sbcd90 7356f94
throw exception only if all fanouts failed
sbcd90 baea3d6
fix builds again
sbcd90 eb7a9f0
fix builds again
sbcd90 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ package org.opensearch.alerting.action | |
|
||
import org.opensearch.alerting.model.DocumentLevelTriggerRunResult | ||
import org.opensearch.alerting.model.InputRunResults | ||
import org.opensearch.alerting.util.AlertingException | ||
import org.opensearch.core.action.ActionResponse | ||
import org.opensearch.core.common.io.stream.StreamInput | ||
import org.opensearch.core.common.io.stream.StreamOutput | ||
|
@@ -22,6 +23,7 @@ class DocLevelMonitorFanOutResponse : ActionResponse, ToXContentObject { | |
val lastRunContexts: MutableMap<String, Any> | ||
val inputResults: InputRunResults | ||
val triggerResults: Map<String, DocumentLevelTriggerRunResult> | ||
val exception: AlertingException? | ||
|
||
@Throws(IOException::class) | ||
constructor(sin: StreamInput) : this( | ||
|
@@ -30,7 +32,8 @@ class DocLevelMonitorFanOutResponse : ActionResponse, ToXContentObject { | |
monitorId = sin.readString(), | ||
lastRunContexts = sin.readMap()!! as MutableMap<String, Any>, | ||
inputResults = InputRunResults.readFrom(sin), | ||
triggerResults = suppressWarning(sin.readMap(StreamInput::readString, DocumentLevelTriggerRunResult::readFrom)) | ||
triggerResults = suppressWarning(sin.readMap(StreamInput::readString, DocumentLevelTriggerRunResult::readFrom)), | ||
exception = sin.readException() | ||
) | ||
|
||
constructor( | ||
|
@@ -40,13 +43,15 @@ class DocLevelMonitorFanOutResponse : ActionResponse, ToXContentObject { | |
lastRunContexts: MutableMap<String, Any>, | ||
inputResults: InputRunResults = InputRunResults(), // partial, | ||
triggerResults: Map<String, DocumentLevelTriggerRunResult> = mapOf(), | ||
exception: AlertingException? = null | ||
) : super() { | ||
this.nodeId = nodeId | ||
this.executionId = executionId | ||
this.monitorId = monitorId | ||
this.lastRunContexts = lastRunContexts | ||
this.inputResults = inputResults | ||
this.triggerResults = triggerResults | ||
this.exception = exception | ||
} | ||
|
||
@Throws(IOException::class) | ||
|
@@ -61,6 +66,7 @@ class DocLevelMonitorFanOutResponse : ActionResponse, ToXContentObject { | |
StreamOutput::writeString, | ||
{ stream, stats -> stats.writeTo(stream) } | ||
) | ||
out.writeException(exception) | ||
} | ||
|
||
@Throws(IOException::class) | ||
|
@@ -72,6 +78,7 @@ class DocLevelMonitorFanOutResponse : ActionResponse, ToXContentObject { | |
.field("last_run_contexts", lastRunContexts) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rest of the fields? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed it. |
||
.field("input_results", inputResults) | ||
.field("trigger_results", triggerResults) | ||
.field("exception", exception) | ||
.endObject() | ||
return builder | ||
} | ||
|
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.
plz log exception. If we dont log exception debugging is tough .
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.
addressed this.