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.
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
Make grouping deterministic #225
base: master
Are you sure you want to change the base?
Make grouping deterministic #225
Changes from all commits
04e6a38
e2e3735
b8ecd82
41d76c2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Can we make this final, non-abstract, and rename it to
TextDocGrouper
maybe? No need for separate subclass since we have no binary case anymore?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.
We still need a
NoGroupImpl
to deal with the case where we don't need groups, or we can handle that difference inLineFileDocs
which requires several if/else there... I'm ok with either but think this might be (slightly) cleaner?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.
Add comment that this is lazily initialized only 1) during indexing, and 2) when grouping is enabled?
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.
Could these maybe become non-static now? Init them on construction of
TextDocGrouper
class? And fix indexer threads to reference them in this instance?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.
Actually why they are static previously?
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.
Not certain :) I think because there was no obvious singleton instantiated class to store them on (though,
IndexThreads
could've been used, hmm)? But this newDocGrouper
is instantiated once, and is all about grouping, so it seems like the right place to put these compute-once group values?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.
Maybe remove
i
and change towhile (idSet.size() < count) { ... }
?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.
Hmm can we eliminate this? It seems wasteful way to do nothing? (putting a single doc into a new
DocGroup
into the queue for threads to then read? Can we just addif (addGroupingFields == false)
and skip adding grouping fields in index threads?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.
Then we need to retrieve lfd in two different ways, one with group one without, means we need to keep 2 blocking queues in
LineFileDocs
and have 2 ways to retrieve them..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.
OK, I see. Then I think you're right -- let's keep the abstract base class and the no-op subclass?
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.
Hmm are
LineFileDoc
instances reused (it's unsafe to buffer/hold onto more than one at a time in a thread)?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.
No I don't think they're reused?
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.
Remove this?
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.
Looks like we must also keep this, since we're going with the
NoGroupImpl
approach?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.
Also elide this class up into super class, and have only a
TextDocGroups
?