Skip to content

Correct index path validation knn-qa testing tool #129144

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Correct index path validation
  • Loading branch information
benwtrent committed Jun 9, 2025
commit 82c66223d4c081b08b4ac5a26711f9fa72dd71f1
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,8 @@ public static void main(String[] args) throws Exception {
cmdLineArgs.vectorSpace(),
cmdLineArgs.numDocs()
);
if (Files.exists(indexPath) == false) {
if (cmdLineArgs.reindex() == false) {
throw new IllegalArgumentException("Index path does not exist: " + indexPath);
}
if (cmdLineArgs.forceMerge()) {
throw new IllegalArgumentException("Force merging without an existing index in: " + indexPath);
}
if (cmdLineArgs.reindex() == false && Files.exists(indexPath) == false) {
throw new IllegalArgumentException("Index path does not exist: " + indexPath);
}
if (cmdLineArgs.reindex()) {
knnIndexer.createIndex(result);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ private void readNext() throws IOException {
bytes.position(0);
// wrap around back to the start of the file if we hit the end:
logger.warn("VectorReader hit EOF when reading " + this.input + "; now wrapping around to start of file again");
this.input.position(position);
input.position(position);
bytesRead = Channels.readFromFileChannel(this.input, position, bytes);
if (bytesRead < bytes.capacity()) {
throw new IllegalStateException(
Expand Down