TieredIndex

View as Markdown

Java package: com.nvidia.cuvs

1public interface TieredIndex extends AutoCloseable

TieredIndex encapsulates a Tiered index, along with methods to interact with it.

Public Members

close

1@Override void close() throws Exception

Destroys the underlying native TieredIndex object and releases associated resources.

Throws

TypeDescription
Exceptionif an error occurs during index destruction

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/TieredIndex.java:22

1SearchResults search(TieredIndexQuery query) throws Throwable

Searches the index with the specified query and search parameters.

Parameters

NameDescription
queryAn instance of TieredIndexQuery describing the queries and search parameters

Returns

An instance of SearchResults containing the k-nearest neighbors and their distances for each query

Throws

TypeDescription
Throwableif an error occurs during the search operation

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/TieredIndex.java:34

getIndexType

1TieredIndexType getIndexType()

Returns the algorithm type backing this TieredIndex.

Returns

The TieredIndexType indicating the underlying algorithm (e.g., CAGRA)

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/TieredIndex.java:42

getCuVSResources

1CuVSResources getCuVSResources()

Returns the resources handle associated with this TieredIndex.

Returns

The CuVSResources instance used by this index

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/TieredIndex.java:49

newBuilder

1static Builder newBuilder(CuVSResources cuvsResources)

Creates a new Builder with an instance of CuVSResources.

Parameters

NameDescription
cuvsResourcesAn instance of CuVSResources

Returns

A new Builder instance for constructing a TieredIndex

Throws

TypeDescription
NullPointerExceptionif cuvsResources is null

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/TieredIndex.java:58

extend

1ExtendBuilder extend()

Returns an ExtendBuilder to add new data to the existing index.

Returns

An ExtendBuilder instance for extending the index

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/TieredIndex.java:68

from

1Builder from(InputStream inputStream)

Parameters

NameDescription
inputStreamThe input stream containing serialized index data

Returns

This Builder instance for method chaining

Throws

TypeDescription
UnsupportedOperationExceptionas deserialization is not yet supported

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/TieredIndex.java:82

withDataset

1Builder withDataset(float[][] vectors)

Sets the dataset vectors for building the TieredIndex.

Parameters

NameDescription
vectorsA two-dimensional float array containing the dataset vectors [n_vectors, dimensions]

Returns

This Builder instance for method chaining

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/TieredIndex.java:91

withDataset

1Builder withDataset(CuVSMatrix dataset)

Sets the dataset for building the TieredIndex.

Parameters

NameDescription
datasetA CuVSMatrix instance containing the vectors

Returns

This Builder instance for method chaining

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/TieredIndex.java:99

withIndexParams

1Builder withIndexParams(TieredIndexParams params)

Registers TieredIndex parameters with this Builder.

Parameters

NameDescription
paramsAn instance of TieredIndexParams containing the index configuration

Returns

This Builder instance for method chaining

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/TieredIndex.java:108

withIndexType

1Builder withIndexType(TieredIndexType indexType)

Sets the index type for the TieredIndex.

Parameters

NameDescription
indexTypeThe TieredIndexType to use (currently only CAGRA is supported)

Returns

This Builder instance for method chaining

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/TieredIndex.java:117

build

1TieredIndex build() throws Throwable

Builds and returns an instance of TieredIndex with the configured parameters.

Returns

A new TieredIndex instance

Throws

TypeDescription
Throwableif an error occurs during index construction
IllegalArgumentExceptionif both vectors and dataset are provided, or if required parameters are missing

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/TieredIndex.java:129

withDataset

1ExtendBuilder withDataset(float[][] vectors)

Sets the vectors to add to the existing index.

Parameters

NameDescription
vectorsA two-dimensional float array containing the new vectors to add [n_new_vectors, dimensions]

Returns

This ExtendBuilder instance for method chaining

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/TieredIndex.java:152

withDataset

1ExtendBuilder withDataset(CuVSMatrix dataset)

Sets the dataset to add to the existing index.

Parameters

NameDescription
datasetA CuVSMatrix instance containing the new vectors to add

Returns

This ExtendBuilder instance for method chaining

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/TieredIndex.java:161

execute

1void execute() throws Throwable

Executes the extend operation, adding the specified data to the index.

Throws

TypeDescription
Throwableif an error occurs during the extend operation
IllegalArgumentExceptionif both vectors and dataset are provided, or if no data is provided

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/TieredIndex.java:171

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/TieredIndex.java:15