Utils
Java package: com.nvidia.cuvs.lucene
This class provides common static utility methods.
Public Members
handleThrowable
A utility method that rethrows known throwable types without changing their identity.
In particular, Error instances must not be converted to a RuntimeException; callers rely on errors retaining their original type and stack trace.
This method never returns normally; its return type exists solely so callers can write
throw handleThrowable(t);, letting the compiler verify that the enclosing statement
always completes abruptly.
Parameters
Returns
never returns; always throws
Throws
Source: java/cuvs-lucene/src/main/java/com/nvidia/cuvs/lucene/Utils.java:40
closeAll
Closes every non-null closeable, even if some fail, and returns the first failure with the others added as suppressed.
Parameters
Returns
failure, or the first close failure if it is null; null if nothing failed
Source: java/cuvs-lucene/src/main/java/com/nvidia/cuvs/lucene/Utils.java:58
createFloatMatrix
A method to build a CuVSMatrix from a list of float vectors.
Uses CuVSMatrix.Builder to copy vectors directly to device memory without creating intermediate heap arrays.
Parameters
Returns
an instance of CuVSMatrix
Source: java/cuvs-lucene/src/main/java/com/nvidia/cuvs/lucene/Utils.java:88
createHostByteMatrixFromArray
Builds a host-memory CuVSMatrix from a 2D byte array.
Source: java/cuvs-lucene/src/main/java/com/nvidia/cuvs/lucene/Utils.java:107
nanosToMillis
A utility method to convert nanoseconds to milliseconds.
Parameters
Returns
milliseconds
Source: java/cuvs-lucene/src/main/java/com/nvidia/cuvs/lucene/Utils.java:188
cuVSResourcesOrNull
Creates an instance of CuVSResources.
Returns
an instance of CuVSResources
Source: java/cuvs-lucene/src/main/java/com/nvidia/cuvs/lucene/Utils.java:197
handleThrowableWithIgnore
A utility method that conditionally ignores certain throwable objects
Parameters
Throws
Source: java/cuvs-lucene/src/main/java/com/nvidia/cuvs/lucene/Utils.java:225
info
Utility to print info/debug messages via InfoStream.
Parameters
Source: java/cuvs-lucene/src/main/java/com/nvidia/cuvs/lucene/Utils.java:239
Source: java/cuvs-lucene/src/main/java/com/nvidia/cuvs/lucene/Utils.java:23