com.aerospike.vector.client.adminclient.IAdminClient Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of avs-client-java Show documentation
Show all versions of avs-client-java Show documentation
This project includes the Java client for Aerospike Vector Search for high-performance data interactions.
The newest version!
package com.aerospike.vector.client.adminclient;
import com.aerospike.vector.client.proto.*;
import javax.annotation.Nullable;
import java.io.Closeable;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* 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;
/**
* Get information about a user.
* @param username the username to fetch the user information for
* @return the user information
*/
User getUser(String username);
/**
* Add a user and grant roles.
*
* @param credentials new user credentials.
* @param roles the roles to grant to the new application user.
*/
void addUser(com.aerospike.vector.client.auth.Credentials credentials, Set roles);
/**
* Update user with new credentials.
* @param credentials new user credentials.
*/
void updateCredentials(com.aerospike.vector.client.auth.Credentials credentials);
/**
* Drop a user.
* @param username the username to drop.
*/
void dropUser(String username);
/**
* List all users.
* @return a list of all users
*/
List userList();
/**
* Grant roles to a user.
* @param username the username to grant roles to
* @param roles the roles to grant
*/
void grantRoles(String username, Set roles);
/**
* Revoke roles from a user.
* @param username the username to revoke roles from
* @param roles the roles to revoke
*/
void revokeRoles(String username, Set roles);
/**
* List all roles.
* @return a list of all roles
*/
List roleList();
}