-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Switch aggregations from push to pull #19839
Conversation
woops, compile error with a testing plugin. will fix. |
@rjernst would you like to look at this one? It is the last "plugin API" change for search. |
/** | ||
* Package private with the intent that it is used for testing. | ||
*/ | ||
interface TestPlugin extends SearchPlugin { |
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.
I don't think we need test code in production. Instead, can you add this method to Node, and have MockNode override it? Eventually, we can change it to createSearchService
, once we can construct IndicesService
without guice (really close..we can probably do that in a follow up, all the pieces are attainable).
Looks ok to me. I'm still not a fan of the generics, but they are in line with what you have for the rest of the search plugin methods. The one comment I left is my only ask. |
@rjernst - I moved the testing hook into MockNode. It turns out that MockNode was actually broken so I had to rework it some. Would you like to take a look? |
|
||
public MockNode(Settings settings, Collection<Class<? extends Plugin>> classpathPlugins) { | ||
super(InternalSettingsPreparer.prepareEnvironment(settings, null), classpathPlugins); | ||
this.plugins = classpathPlugins; | ||
this.mockBigArrays = classpathPlugins.contains(NodeMocksPlugin.class); // if this plugin is present we mock bigarrays :) |
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.
This didn't work because we use the value of mockBigArrays
in the super
call above. But we hadn't yet set mockBigArrays
.
@rjernst I pushed an update that did the thing you wanted. |
LGTM |
Adds `getAggregations` to `SearchPlugin` which can be used to register aggregations. Fixup MockNode which wasn't createing MockBigArrays.
Adds
getAggregations
andgetPipelineAggregations
toSearchPlugin
which can be used to registeraggregations. Makes overriding
onModule(SearchModule)
in aPlugin
a compile error.Also removes many
ParseField
s which are now implied by the registration mechanism that we expose to plugins.