-
Notifications
You must be signed in to change notification settings - Fork 24.6k
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
Conversation
|
||
private final String databaseFileName; | ||
private final CheckedSupplier<DatabaseReader, IOException> loader; | ||
DatabaseReader databaseReader; |
There was a problem hiding this comment.
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?
There was a problem hiding this 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; |
There was a problem hiding this comment.
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.
0d1d130
to
36bdbce
Compare
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.
36bdbce
to
211d50f
Compare
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.