Skip to content

Improve interning in SQLMetadataSegmentManager#6357

Merged
gianm merged 2 commits intoapache:masterfrom
metamx:SQLMetadataSegmentManager-segment-interning
Sep 22, 2018
Merged

Improve interning in SQLMetadataSegmentManager#6357
gianm merged 2 commits intoapache:masterfrom
metamx:SQLMetadataSegmentManager-segment-interning

Conversation

@leventov
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

4 participants