Skip to content

Make PreBuiltAnalyzerProviderFactory plugable via AnalysisPlugin and#31095

Merged
martijnvg merged 2 commits intoelastic:masterfrom
martijnvg:make_PreBuiltAnalyzerProviderFactory_pluggable
Jun 6, 2018
Merged

Make PreBuiltAnalyzerProviderFactory plugable via AnalysisPlugin and#31095
martijnvg merged 2 commits intoelastic:masterfrom
martijnvg:make_PreBuiltAnalyzerProviderFactory_pluggable

Conversation

@martijnvg
Copy link
Copy Markdown
Member

move finger_print, pattern and standard_html_strip analyzers
to analysis-common module. (both AnalysisProvider and PreBuiltAnalyzerProvider)

Changed PreBuiltAnalyzerProviderFactory to extend from PreConfiguredAnalysisComponent and
changed to make sure that predefined analyzers are always instantiated with the current
ES version and if an instance is requested for a different version then delegate to PreBuiltCache.
This is similar to the behaviour that exists today in AnalysisRegistry.PreBuiltAnalysis and
PreBuiltAnalyzerProviderFactory.

Relates to #23658

@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-search-aggs

Copy link
Copy Markdown
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 left a few minor things but I'm marking this "request changes" because I'm confused about how closing works with PreBuiltAnalyzers.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think the old indentation was better here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it'd be nice to remove this second ctor so we're explicit every time.

Copy link
Copy Markdown
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 worth some javadoc and comments to explain why we do it. It makes sense but things like an empty put method will confuse future me when I read this class in six months.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It'd be super nice to explain that we only need this because of PreBuiltAnalyzers.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It looks to me like this will hit a NullPointerException.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

When you use it with an instance of PreBuiltAnalyzers.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

good catch. I will fix that.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

setupPreBuiltAnalyzerProviderFactories?

@martijnvg
Copy link
Copy Markdown
Member Author

Thanks @nik9000 for reviewing. I've updated this PR.

martijnvg added 2 commits June 5, 2018 20:05
move `finger_print`, `pattern` and `standard_html_strip` analyzers
to analysis-common module. (both AnalysisProvider and PreBuiltAnalyzerProvider)

Changed PreBuiltAnalyzerProviderFactory to extend from PreConfiguredAnalysisComponent and
changed to make sure that predefined analyzers are always instantiated with the current
ES version and if an instance is requested for a different version then delegate to PreBuiltCache.
This is similar to the behaviour that exists today in AnalysisRegistry.PreBuiltAnalysis and
PreBuiltAnalyzerProviderFactory.

Relates to elastic#23658
@martijnvg martijnvg force-pushed the make_PreBuiltAnalyzerProviderFactory_pluggable branch from 506bdcc to 97f7539 Compare June 5, 2018 18:06
@martijnvg martijnvg merged commit 735d0e6 into elastic:master Jun 6, 2018
martijnvg added a commit that referenced this pull request Jun 6, 2018
move `finger_print`, `pattern` and `standard_html_strip` analyzers
to analysis-common module. (both AnalysisProvider and PreBuiltAnalyzerProvider)

Changed PreBuiltAnalyzerProviderFactory to extend from PreConfiguredAnalysisComponent and
changed to make sure that predefined analyzers are always instantiated with the current
ES version and if an instance is requested for a different version then delegate to PreBuiltCache.
This is similar to the behaviour that exists today in AnalysisRegistry.PreBuiltAnalysis and
PreBuiltAnalyzerProviderFactory. (#31095)

Relates to #23658
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