NVIDIA / NVIDIA/cuvs

[Improvement] [Java] Cleaner approach to using enums

Open
#989 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Cuda
Stars
854
Forks
236
Avg merge
3d 3h
Merged PRs (30d)
62

Description

Currently, the Java Panama API based layer in the Java API uses integer values for actual enum options, which makes the code less readable. This task is to replace this approach with using enum options instead.

Also, currently, we maintain Java enums for certain enums in the C layer, for example cuvsCagraGraphBuildAlgo in the C layer has a Java enum. This in its current form, involves manual intervention, especially when enums in the C layer change and so this needs a better approach.

Assigning this task to self.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the Java Panama API layer and comparing its integer enum options with the C definitions in cpp/include/cuvs/neighbors/cagra.h and the Java enum in java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndexParams.java. Define the approach for replacing integer values and avoiding manual synchronization when C-layer enums change; the issue provides no tests or validation command.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, java
Domain
api
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.