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

Lazy load the geoip databases #23337

Merged
merged 1 commit into from
Feb 24, 2017

Conversation

martijnvg
Copy link
Member

Load the geoip database the first time a pipeline gets created that has a geoip processor.
This saves memory (measured ~150MB for the city db) in cases when the plugin is installed, but not used.


private final String databaseFileName;
private final CheckedSupplier<DatabaseReader, IOException> loader;
DatabaseReader databaseReader;
Copy link
Member

Choose a reason for hiding this comment

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

Use SetOnce and make it final?

@talevy talevy added the :Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP label Feb 23, 2017
Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

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

LGTM


private final String databaseFileName;
private final CheckedSupplier<DatabaseReader, IOException> loader;
final SetOnce<DatabaseReader> databaseReader;
Copy link
Member

Choose a reason for hiding this comment

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

please add a comment that it is package private to allow for testing.

@martijnvg martijnvg force-pushed the lazy_load_geoip_database branch 2 times, most recently from 0d1d130 to 36bdbce Compare February 24, 2017 07:51
Load the geoip database the first time a pipeline gets created that has a geoip processor.
This saves memory (measured ~150MB for the city db) in cases when the plugin is installed, but not used.
@martijnvg martijnvg merged commit 211d50f into elastic:master Feb 24, 2017
@clintongormley clintongormley added :Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP and removed :Plugin Ingest GeoIp labels Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP >enhancement v5.3.0 v5.4.0 v6.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants