Skip to content

Move Java example projects under examples/java/ - #2543

Open
imotov wants to merge 2 commits into
NVIDIA:mainfrom
imotov:issue-2542-move-java-examples
Open

Move Java example projects under examples/java/#2543
imotov wants to merge 2 commits into
NVIDIA:mainfrom
imotov:issue-2542-move-java-examples

Conversation

@imotov

@imotov imotov commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Move java/examples and java/cuvs-lucene/examples to examples/java/cuvs-java and examples/java/cuvs-lucene, matching the existing examples for C, C++ and Go.

Add a --build-java-examples flag to build.sh, java/build.sh, and java/cuvs-lucene/build.sh that compiles the examples against the jar just built, and wire it into ci/build_java.sh/ci/build_lucene.sh so CI catches drift between the examples and the cuvs-java/cuvs-lucene API. Fix the examples themselves, which had silently drifted from the current API (builder signatures now require CuVSResources, destroyIndex() -> close(), CagraQuery needs a CuVSMatrix, and CAGRA search now requires an explicit device-padded dataset).

Closes #2448
Closes #2542

Move java/examples and java/cuvs-lucene/examples to examples/java/cuvs-java and examples/java/cuvs-lucene, matching the existing examples for C, C++ and Go.

Add a --build-java-examples flag to build.sh, java/build.sh, and java/cuvs-lucene/build.sh that compiles the examples against the jar just built, and wire it into ci/build_java.sh/ci/build_lucene.sh so CI catches drift between the examples and the cuvs-java/cuvs-lucene API. Fix the examples themselves, which had silently drifted from the current API (builder signatures now require CuVSResources, destroyIndex() -> close(), CagraQuery needs a CuVSMatrix, and CAGRA search now requires an explicit device-padded dataset).

Closes NVIDIA#2448
Closes NVIDIA#2542
@copy-pr-bot

copy-pr-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@imotov imotov added improvement Improves an existing functionality non-breaking Introduces a non-breaking change labels Sep 2, 2026
@imotov

imotov commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test c01744c

@imotov imotov self-assigned this Sep 2, 2026
@imotov
imotov marked this pull request as ready for review September 2, 2026 19:38
@imotov
imotov requested review from a team as code owners September 2, 2026 19:38
@imotov
imotov requested a review from bdice September 2, 2026 19:38

@jameslamb jameslamb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

approved with a minor suggestion

Comment thread .github/workflows/pr.yaml
- 'examples/build.sh'
- 'examples/c/**'
- 'examples/cmake/**'
- 'examples/cpp/**'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
- 'examples/cpp/**'
- '!examples/.gitignore'
- '!examples/java'

I think it's be a bit simpler to keep these list as only exclusions (!) instead of mixing inclusions and exclusions. In my opinion, that makes them easier to reason about. Could you apply similar changes through the rest of the changed-files diff in this PR please?

@jameslamb
jameslamb removed the request for review from bdice September 4, 2026 17:45
Comment on lines +116 to +117
index.close();
hnswIndex.close();

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.

Yikes, thank you for fixing this. We should have done that when we fixed #1252. Sorry I missed that.

@mythrocks mythrocks left a comment

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.

👍 Thank you, this is much more streamlined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improves an existing functionality non-breaking Introduces a non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consolidate cuvs-java and cuvs-lucene examples in examples/java directory Lucene: Add examples option to build.sh

3 participants