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

Improve interning in SQLMetadataSegmentManager #6357

Merged

Conversation

leventov
Copy link
Member

The segments that are stored in SQLMetadataSegmentManager.DATA_SEGMENT_INTERNER are the same as in SQLMetadataSegmentManager.dataSourcesRef, so we could effectively use the latter for interning. It allows to get rid of one large Map of weak references which are probably bad for GC themselves.

Also interning doesn't make sense in enableDatasource().

Originally interning was introduced in #3267.

@leventov
Copy link
Member Author

Also related to #6358, that I intend to fix later.

/**
* For the garbage collector in Java, it's better to keep new objects short-living, but once they are old enough
* (i. e. promoted to old generation), try to keep them alive. In {@link #poll()}, we fetch and deserialize all
* existing segments each time, and them replace them in {@link #dataSourcesRef}. This method allows to use already
Copy link
Contributor

Choose a reason for hiding this comment

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

typo them

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, fixed

Copy link
Contributor

@gianm gianm left a comment

Choose a reason for hiding this comment

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

LGTM.

@gianm gianm merged commit 9a3195e into apache:master Sep 22, 2018
@leventov leventov deleted the SQLMetadataSegmentManager-segment-interning branch September 22, 2018 20:57
leventov added a commit to metamx/druid that referenced this pull request Sep 25, 2018
* Improve interning in SQLMetadataSegmentManager

* typo
@dclim dclim added this to the 0.13.0 milestone Oct 9, 2018
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.

None yet

4 participants