Refine IndexHandler methods a bit to make them reentrant#9440
Merged
Jackie-Jiang merged 1 commit intoapache:masterfrom Sep 21, 2022
Merged
Refine IndexHandler methods a bit to make them reentrant#9440Jackie-Jiang merged 1 commit intoapache:masterfrom
Jackie-Jiang merged 1 commit intoapache:masterfrom
Conversation
vvivekiyer
reviewed
Sep 20, 2022
| _segmentMetadata = segmentMetadata; | ||
| _fstType = indexLoadingConfig.getFSTIndexType(); | ||
| _columnsToAddIdx = new HashSet<>(indexLoadingConfig.getFSTIndexColumns()); | ||
| _columnsToAddIdx = indexLoadingConfig.getFSTIndexColumns(); |
Contributor
There was a problem hiding this comment.
(nit) Isn't it probably cleaner and safer (from future changes) to not have _columnsToAddIdx as a private member? Instead just have _indexLoadingConfig as a private member and compute columnsToAddIdx in the respective methods?
This is the pattern followed in other handlers like BloomFilterHandler,H3IndexHandler.
Contributor
Author
There was a problem hiding this comment.
I see BF/H3 hander doesn't hold indexLoadingConfig reference either, but configs for creating BF/H3.
The handlers in this PR don't have specific configs from indexLoadingConfig either, so not hold its reference.
Contributor
|
lgtm overall |
somandal
approved these changes
Sep 20, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use a defensive copy to make the IndexHandler methods reentrant and less confusing to use. This is not an issue today, as IndexHandler object is not reused.