
com.aerospike.vector.client.adminclient.IAdminClient Maven / Gradle / Ivy
package com.aerospike.vector.client.adminclient;
import com.aerospike.vector.client.*;
import javax.annotation.Nullable;
import java.io.Closeable;
import java.util.List;
import java.util.Map;
/**
* The IAdminClient interface provides methods for managing indices
* within a vector database. It extends the Closeable interface, which
* allows instances of classes implementing this interface to be closed
* in order to release system resources.
*/
public interface IAdminClient extends Closeable {
/**
* Creates a new index for vector search.
*
* @param indexId Unique identifier for the index.
* @param vectorFieldName Name of the bin in the records that contains the vector to index.
* @param dimensions Dimensionality of the indexed vectors.
* @param vectorDistanceMetric Metric used to calculate distance in the vector space.
* @param setFilter Optional filter to only select a subset of the records from a specific set.
* @param indexParams Optional parameters to fine-tune the index configuration.
* @param storage Optional storage parameters for the index, such as persistence settings.
* @param labels Optional user-specific labels to attach to the index for identification or categorization.
* @param timeoutInMillis The maximum time in milliseconds that the method will wait for the index to be visible.
* @param waitTimeInMillis Sleep duration between before consecutive checks if the index is available.
* @throws RuntimeException if there is a runtime error during index creation.
*/
void indexCreate(IndexId indexId,
String vectorFieldName,
int dimensions,
VectorDistanceMetric vectorDistanceMetric,
@Nullable String setFilter,
@Nullable HnswParams indexParams,
@Nullable IndexStorage storage,
Map labels,
long timeoutInMillis,
long waitTimeInMillis) throws RuntimeException;
/**
* Deletes an index based on its unique identifier.
*
* @param indexId Unique identifier for the index to be dropped.
* @param timeoutInMillis The maximum time in milliseconds that the method will wait for the index to get deleted.
* @param waitTimeInMillis Sleep duration between before consecutive checks if the index is not available.
* @throws RuntimeException if there is a runtime error during index deletion.
*/
void indexDrop(IndexId indexId, long timeoutInMillis, long waitTimeInMillis ) throws RuntimeException;
/**
* Lists all indexes in the database.
*
* @return A list of IndexDefinition objects, each representing an index in the database.
* @throws RuntimeException if there is a runtime error during the retrieval of index information.
*/
List indexList() throws RuntimeException;
/**
* Retrieves the current status of an index.
*
* @param indexId Unique identifier for the index.
* @return An IndexStatusResponse object containing the current status of the index.
* @throws RuntimeException if there is a runtime error while fetching the index status.
*/
IndexStatusResponse indexStatus(IndexId indexId) throws RuntimeException;
/**
* Retrieves the definition of a specific index by its identifier.
*
* @param indexId Unique identifier for the index.
* @return An IndexDefinition object representing the configuration and metadata of the index.
* @throws RuntimeException if there is a runtime error while fetching the index definition.
*/
IndexDefinition getIndex(IndexId indexId) throws RuntimeException;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy