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

Small refactorings in analysis-related components #40745

Merged
merged 1 commit into from
Apr 3, 2019

Conversation

cbuescher
Copy link
Member

Some changes I made while working on updateable synonyms, these make sense as their own PR I think:

  • wrap input analyzers into an unmodifiable map in IndexAnalyzers ctor
    Currently we do this in some places when calling the ctor. I think we should generally make sure the internal
    maps are not modifiable. This makes reasoning about the class much easier.
  • remove duplicated indexSetting (is held in superclass)
    AbstractIndexComponent already has a accessible reference that is just shadowed unnesessarily in IndexAnalyzers
  • removing references to IndexAnalyzers from DocumentMapperParser and TypeParser.ParserContext, we can retrieve it from MapperService in those cases
    This makes it easier to reason about where references to the IndexAnalyzers are kept. Reducing those places makes it easier to swap out or update IndexAnalyzers without having to worry about having stale references somewhere.

* wrap input analyzers into an unmodifiable map in IndexAnalyzers ctor
* remove duplicated indexSetting (is held in superclass)
* removing references to IndexAnalyzers from DocumentMapperParser and
TypeParser.ParserContext, we can retrieve it from MapperService in those cases
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

Copy link
Contributor

@romseygeek romseygeek left a comment

Choose a reason for hiding this comment

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

LGTM, nice cleanups.

@cbuescher
Copy link
Member Author

@romseygeek thanks for the review

@cbuescher cbuescher merged commit efe47ce into elastic:master Apr 3, 2019
cbuescher pushed a commit that referenced this pull request Apr 3, 2019
This change adds the following internal refactorings:

* wraps input analyzers into an unmodifiable map in IndexAnalyzers ctor
* removes duplicated indexSetting in IndexAnalyzers
* removes references to IndexAnalyzers from DocumentMapperParser and TypeParser.ParserContext.
  It can always be retrieve it from MapperService directly in those cases
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Apr 3, 2019
…leniency

* elastic/master:
  SQL: Fix deserialisation issue of TimeProcessor (elastic#40776)
  Improve GCS docs for using keystore (elastic#40605)
  Add Restore Operation to SnapshotResiliencyTests (elastic#40634)
  Small refactorings to analysis components (elastic#40745)
  SQL: Fix display size for DATE/DATETIME (elastic#40669)
  add HLRC protocol tests for transform state and stats (elastic#40766)
  Inline TransportReplAction#registerRequestHandlers (elastic#40762)
  remove experimental label from search_as_you_type documentation (elastic#40744)
  Remove some abstractions from `TransportReplicationAction` (elastic#40706)
  Upgrade to latest build scan plugin (elastic#40702)
  Use default memory lock setting in testing (elastic#40730)
  Add Bulk Delete Api to BlobStore (elastic#40322)
  Remove yaml skips older than 7.0 (elastic#40183)
  Docs: Move id in the java-api (elastic#40748)
gurkankaymak pushed a commit to gurkankaymak/elasticsearch that referenced this pull request May 27, 2019
This change add the following internal refactorings:

* wraps input analyzers into an unmodifiable map in IndexAnalyzers ctor
* removes duplicated indexSetting in IndexAnalyzers
* removes references to IndexAnalyzers from DocumentMapperParser and TypeParser.ParserContext.
   It can always be retrieve it from MapperService directly in those cases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants