Expose ruby_plugin on filter/output delegators#18936
Open
kaisecheng wants to merge 1 commit intoelastic:mainfrom
Open
Expose ruby_plugin on filter/output delegators#18936kaisecheng wants to merge 1 commit intoelastic:mainfrom
kaisecheng wants to merge 1 commit intoelastic:mainfrom
Conversation
Add a ruby_plugin JRuby method to all filter and output delegator types so that callers can access the underlying Ruby plugin instance when inspecting plugin config or instance variables. Ruby-backed delegators (FilterDelegatorExt, OutputDelegatorExt, OutputStrategyExt) return the inner plugin object. Java-native delegators (JavaFilterDelegatorExt, JavaOutputDelegatorExt) return nil because they use the Java config system rather than LogStash::Config::Mixin.
Contributor
🤖 GitHub commentsJust comment with:
|
Contributor
|
This pull request does not have a backport label. Could you fix it @kaisecheng? 🙏
|
💛 Build succeeded, but was flaky
Failed CI Steps |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this PR do?
Add a
ruby_pluginJRuby method to all filter and output delegator types so that callers can access the underlying Ruby plugin instance when inspecting plugin config or instance variables.Ruby-backed delegators (
FilterDelegatorExt,OutputDelegatorExt,OutputStrategyExt) return the inner plugin object. Java-native delegators (JavaFilterDelegatorExt,JavaOutputDelegatorExt) returnnilbecause they use the Java config system rather thanLogStash::Config::Mixin.Why is it important/What is the impact to the user?
Filters and outputs are wrapped in Java delegators whose ancestor chain is the Java class hierarchy. Code that needs to inspect plugin config (e.g. reading SSL certificate paths for hot-reload) must unwrap the delegator first to access
get_configand instance variables. This PR provides a standard unwrapping method across all delegator types.Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration filesHow to test this PR locally
./gradlew :logstash-core:rubyTests --tests "org.logstash.config.ir.compiler.OutputDelegatorTest" --rerun-tasksRelated issues