BruteForceIndex

View as Markdown

Java package: com.nvidia.cuvs

1public interface BruteForceIndex extends AutoCloseable

BruteForceIndex encapsulates a BRUTEFORCE index, along with methods to interact with it.

Public Members

close

1@Override void close() throws Exception

Invokes the native destroy_brute_force_index function to de-allocate BRUTEFORCE index

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceIndex.java:25

1SearchResults search(BruteForceQuery cuvsQuery) throws Throwable

Invokes the native search_brute_force_index via the Panama API for searching a BRUTEFORCE index.

Parameters

NameDescription
cuvsQueryan instance of BruteForceQuery holding the query vectors and other parameters

Returns

an instance of SearchResults containing the results

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceIndex.java:36

serialize

1void serialize(OutputStream outputStream) throws Throwable

A method to persist a BRUTEFORCE index using an instance of OutputStream for writing index bytes.

Parameters

NameDescription
outputStreaman instance of OutputStream to write the index bytes into

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceIndex.java:45

serialize

1void serialize(OutputStream outputStream, Path tempFile) throws Throwable

A method to persist a BRUTEFORCE index using an instance of OutputStream and path to the intermediate temporary file.

Parameters

NameDescription
outputStreaman instance of OutputStream to write the index bytes to
tempFilean intermediate Path where BRUTEFORCE index is written temporarily

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceIndex.java:56

newBuilder

1static Builder newBuilder(CuVSResources cuvsResources)

Creates a new Builder with an instance of CuVSResources.

Parameters

NameDescription
cuvsResourcesan instance of CuVSResources

Throws

TypeDescription
UnsupportedOperationExceptionif the provider does not cuvs

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceIndex.java:64

withIndexParams

1Builder withIndexParams(BruteForceIndexParams bruteForceIndexParams)

Registers an instance of configured BruteForceIndexParams with this Builder.

Parameters

NameDescription
bruteForceIndexParamsAn instance of BruteForceIndexParams

Returns

An instance of this Builder

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceIndex.java:81

from

1Builder from(InputStream inputStream)

Sets an instance of InputStream typically used when index deserialization is needed.

Parameters

NameDescription
inputStreaman instance of InputStream

Returns

an instance of this Builder

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceIndex.java:90

withDataset

1Builder withDataset(float[][] vectors)

Sets the dataset vectors for building the BruteForceIndex.

Parameters

NameDescription
vectorsa two-dimensional float array

Returns

an instance of this Builder

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceIndex.java:98

withDataset

1Builder withDataset(CuVSMatrix dataset)

Sets the dataset for building the BruteForceIndex.

Parameters

NameDescription
dataseta CuVSMatrix object containing the vectors

Returns

an instance of this Builder

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceIndex.java:106

build

1BruteForceIndex build() throws Throwable

Builds and returns an instance of BruteForceIndex.

Returns

an instance of BruteForceIndex

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceIndex.java:113

Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceIndex.java:20