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

Deguice ActionFilters #26691

Merged
merged 1 commit into from
Sep 20, 2017
Merged

Conversation

ywelsch
Copy link
Contributor

@ywelsch ywelsch commented Sep 18, 2017

This makes it possible to instantiate TransportAction (sub)-classes without Guice.

Allows to instantiate TransportAction instances without Guice
@ywelsch ywelsch added :Core/Infra/Core Core issues without another label >non-issue v6.1.0 v7.0.0 labels Sep 18, 2017
Copy link
Member

@nik9000 nik9000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

I think it is probably worth passing ThreadPool as an argument to getActionFilters.

ResourceWatcherService resourceWatcherService, ScriptService scriptService,
NamedXContentRegistry xContentRegistry, Environment environment,
NodeEnvironment nodeEnvironment, NamedWriteableRegistry namedWriteableRegistry) {
loggingFilter.set(new LoggingFilter(clusterService.getSettings(), threadPool));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a sign that getActionFilters maybe should take ThreadPool as an argument.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is meant to be extended by plugins, it's unclear what parameters would be useful to them. I think it's best to keep the interface lean.

@rjernst rjernst self-assigned this Sep 18, 2017
@rjernst rjernst self-requested a review September 18, 2017 16:59
@rjernst rjernst removed their assignment Sep 18, 2017
ResourceWatcherService resourceWatcherService, ScriptService scriptService,
NamedXContentRegistry xContentRegistry, Environment environment,
NodeEnvironment nodeEnvironment, NamedWriteableRegistry namedWriteableRegistry) {
testFilter.set(new ReindexFromRemoteWithAuthTests.TestFilter(threadPool));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The purpose of createComponents is to create services. This creates an unenforcible ordering dependency between creating these services and calling getActionFilters(). getActionFilters should take whatever is necessary to creation action filters.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getActionFilters is meant to be used by plugins, for which we don't know about the parameters that they require. We have the same situation for a lot of other methods (e.g. getRestHandlers). In case of incorrect ordering, our tests will blow up.

@ywelsch ywelsch merged commit ff1e262 into elastic:master Sep 20, 2017
ywelsch added a commit that referenced this pull request Sep 20, 2017
Allows to instantiate TransportAction instances without Guice.
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Sep 20, 2017
* master:
  [DOCS] Added index-shared4 and index-shared5.asciidoc
  BulkProcessor flush runnable preserves the thread context from creation time (elastic#26718)
  Catch exceptions and inform handler in RemoteClusterConnection#collectNodes (elastic#26725)
  [Docs] Fix name of character filter in example. (elastic#26724)
  Remove parse field deprecations in query builders (elastic#26711)
  elastic#26720: Set the correct bwc version after backport to 6.0
  Remove deprecated type and slop field in MatchQueryBuilder (elastic#26720)
  Refactoring of Gateway*** classes (elastic#26706)
  Make RestHighLevelClient's Request class public (elastic#26627)
  Deguice ActionFilter (elastic#26691)
  aggs: Allow aggregation sorting via nested aggregation.
  Build: Set bwc builds to always set snapshot (elastic#26704)
  File Discovery: Remove fallback with zen discovery (elastic#26667)
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.

4 participants