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

LUCENE-9583: Remove RandomAccessVectorValuesProducer #1071

Merged
merged 7 commits into from Aug 20, 2022

Conversation

jtibshirani
Copy link
Member

This change folds the RandomAccessVectorValuesProducer interface into
RandomAccessVectorValues. This reduces the number of interfaces and clarifies
the cloning/ copying behavior.

This is a small simplification related to LUCENE-9583, but does not address the
main issue.

Copy link
Contributor

@mayya-sharipova mayya-sharipova left a comment

Choose a reason for hiding this comment

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

@jtibshirani Thanks! Very nice refactoring and simplificaiton!

@@ -192,36 +176,5 @@ public int advance(int target) throws IOException {
public long cost() {
return size();
}

@Override
public RandomAccessVectorValues randomAccess() throws IOException {
Copy link
Contributor

Choose a reason for hiding this comment

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

Very nice simplification!

Copy link
Contributor

Choose a reason for hiding this comment

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

This is kind of funny to me since it is kind of back to a much earlier iteration where these were all on the same interface, but I split them apart as a way to try and hide the random access that people didn't like :) Although it was never very successful. Anyway I am +1 to get rid of the fig leaf

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed we never reached a great resolution there! I'm trying to chip away at some of these tricky design questions, we'll see how it goes...

@@ -308,41 +302,6 @@ private void printFanoutHist(Path indexPath) throws IOException {
}
}

@SuppressWarnings("unchecked")
private void dumpGraph(Path docsPath) throws IOException {
Copy link
Contributor

Choose a reason for hiding this comment

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

hm I guess we can always restore. This had been pretty useful in early times when nothing was working ...

Copy link
Member Author

Choose a reason for hiding this comment

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

Let me know anytime you start to miss it and I'll restore it! For now I'll remove it to keep things simple. If we keep it, I'll need to refactor BinaryFileVectors -- which is doable but slightly tricky.

@@ -192,36 +176,5 @@ public int advance(int target) throws IOException {
public long cost() {
return size();
}

@Override
public RandomAccessVectorValues randomAccess() throws IOException {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is kind of funny to me since it is kind of back to a much earlier iteration where these were all on the same interface, but I split them apart as a way to try and hide the random access that people didn't like :) Although it was never very successful. Anyway I am +1 to get rid of the fig leaf

@jtibshirani
Copy link
Member Author

Thank you for the reviews. I'm going to merge since it seems you're both on board with the change.

@jtibshirani jtibshirani merged commit 8308688 into apache:main Aug 20, 2022
@jtibshirani jtibshirani deleted the random-access branch August 20, 2022 01:04
msokolov pushed a commit that referenced this pull request Aug 24, 2022
This change folds the `RandomAccessVectorValuesProducer` interface into
`RandomAccessVectorValues`. This reduces the number of interfaces and clarifies
the cloning/ copying behavior.

This is a small simplification related to LUCENE-9583, but does not address the
main issue.
@msokolov msokolov added this to the 9.4.0 milestone Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants