Skip to content
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

Merged
merged 1 commit into from
Aug 16, 2016
Merged

Conversation

nik9000
Copy link
Member

@nik9000 nik9000 commented Aug 5, 2016

Adds getAggregations and getPipelineAggregations to SearchPlugin which can be used to register
aggregations. Makes overriding onModule(SearchModule) in a Plugin a compile error.

Also removes many ParseFields which are now implied by the registration mechanism that we expose to plugins.

@nik9000 nik9000 added >enhancement review :Search/Search Search-related issues that do not fall into other categories :Core/Infra/Plugins Plugin API and infrastructure v5.0.0-beta1 labels Aug 5, 2016
@nik9000
Copy link
Member Author

nik9000 commented Aug 5, 2016

woops, compile error with a testing plugin. will fix.

@nik9000
Copy link
Member Author

nik9000 commented Aug 8, 2016

@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 {
Copy link
Member

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).

@rjernst
Copy link
Member

rjernst commented Aug 8, 2016

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.

@nik9000
Copy link
Member Author

nik9000 commented Aug 10, 2016

@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 :)
Copy link
Member Author

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.

@nik9000
Copy link
Member Author

nik9000 commented Aug 16, 2016

@rjernst I pushed an update that did the thing you wanted.

@rjernst
Copy link
Member

rjernst commented Aug 16, 2016

LGTM

Adds `getAggregations` to `SearchPlugin` which can be used to register
aggregations.

Fixup MockNode which wasn't createing MockBigArrays.
@nik9000 nik9000 merged commit 46bf8ba into elastic:master Aug 16, 2016
@nik9000 nik9000 removed the :Search/Search Search-related issues that do not fall into other categories label Aug 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants