Skip to content

[Review][Java] Refactor: extract interface from CuVSMatrixBaseImpl#1361

Merged
rapids-bot[bot] merged 2 commits intorapidsai:branch-25.10from
ldematte:java/common-internal-interface
Sep 24, 2025
Merged

[Review][Java] Refactor: extract interface from CuVSMatrixBaseImpl#1361
rapids-bot[bot] merged 2 commits intorapidsai:branch-25.10from
ldematte:java/common-internal-interface

Conversation

@ldematte
Copy link
Copy Markdown
Contributor

This PR extract an internal interface that is used as a base to implement all internal CuVSMatrix types; the interface introduces commonly used field accessors like memorySegment() and toTensor() that we do not want/could not appear on the public interface (e.g. because they expose or require Panama types or internal types).

The new interface is implemented by all concrete matrix types, closing a gap that we had in #1328 (which I realized while working on separate PRs like #1283)

Follow-up of #1328

@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented Sep 23, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@ldematte ldematte changed the title [WIP][Java] Refactor: extract interface from CuVSMatrixBaseImpl [Review][Java] Refactor: extract interface from CuVSMatrixBaseImpl Sep 23, 2025
return new CuVSDeviceMatrixDelegate(this);
}

class CuVSDeviceMatrixDelegate implements CuVSDeviceMatrix {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These got moved to internal implementation classes, for better encapsulation and to use the internal interface type.

return deviceMatrix;
}

class CuVSHostMatrixDelegate implements CuVSHostMatrix {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Same as above

@ldematte ldematte marked this pull request as ready for review September 23, 2025 20:30
@ldematte ldematte requested a review from a team as a code owner September 23, 2025 20:30
@cjnolet cjnolet added improvement Improves an existing functionality non-breaking Introduces a non-breaking change labels Sep 23, 2025
@cjnolet cjnolet moved this from Todo to In Progress in Unstructured Data Processing Sep 23, 2025
@benfred
Copy link
Copy Markdown
Contributor

benfred commented Sep 24, 2025

/ok to test 936c6f4

@benfred
Copy link
Copy Markdown
Contributor

benfred commented Sep 24, 2025

/merge

@rapids-bot rapids-bot Bot merged commit 0317f1e into rapidsai:branch-25.10 Sep 24, 2025
84 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Unstructured Data Processing Sep 24, 2025
enp1s0 pushed a commit to enp1s0/cuvs that referenced this pull request Oct 22, 2025
…apidsai#1361)

This PR extract an internal interface that is used as a base to implement all internal CuVSMatrix types; the interface introduces commonly used field accessors like `memorySegment()` and `toTensor()` that we do not want/could not appear on the public interface (e.g. because they expose or require Panama types or internal types).

The new interface is implemented by all concrete matrix types, closing a gap that we had in rapidsai#1328 (which I realized while working on separate PRs like rapidsai#1283)

Follow-up of rapidsai#1328

Authors:
  - Lorenzo Dematté (https://github.com/ldematte)

Approvers:
  - Ben Frederickson (https://github.com/benfred)

URL: rapidsai#1361
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

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants