Package com.dtsx.astra.sdk.cassio
Class ClusteredMetadataVectorTable
java.lang.Object
com.dtsx.astra.sdk.cassio.AbstractCassandraTable<ClusteredMetadataVectorRecord>
com.dtsx.astra.sdk.cassio.ClusteredMetadataVectorTable
public class ClusteredMetadataVectorTable
extends AbstractCassandraTable<ClusteredMetadataVectorRecord>
Table representing persistence for LangChain operations.
- parition key: partitionId
- clustering key: rowId
- column: value
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder class for creating instances ofClusteredMetadataVectorTable. -
Field Summary
Fields inherited from class com.dtsx.astra.sdk.cassio.AbstractCassandraTable
ATTRIBUTES_BLOB, BODY_BLOB, COLUMN_SIMILARITY, cqlSession, DEFAULT_RECORD_COUNT, keyspaceName, METADATA_S, PARTITION_ID, ROW_ID, SAI_INDEX_CLASSNAME, tableName, VECTOR -
Constructor Summary
ConstructorsConstructorDescriptionClusteredMetadataVectorTable(@NonNull com.datastax.oss.driver.api.core.CqlSession session, @NonNull String keyspaceName, @NonNull String tableName, @NonNull Integer vectorDimension, @NonNull CassandraSimilarityMetric metric) Constructor with mandatory parameters.ClusteredMetadataVectorTable(com.datastax.oss.driver.api.core.CqlSession session, String keyspaceName, String tableName, int vectorDimension) Constructor with mandatory parameters. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Builder for the class.voidcreate()Create table if not exist.voidAccess a record by its idvoiddeletePartition(@NonNull String partitionDd) Delete a partition.findPartition(@NonNull String partitionDd) Find a partition.Access a record by its idmapRow(com.datastax.oss.driver.api.core.cql.Row cqlRow) Should be table to map from a Cassandra row to a record.voidUpsert a row of the table.voidsimilaritySearch(AnnQuery query) Compute Similarity Search.Methods inherited from class com.dtsx.astra.sdk.cassio.AbstractCassandraTable
clear, delete, getCqlSession, putAsync
-
Constructor Details
-
ClusteredMetadataVectorTable
public ClusteredMetadataVectorTable(@NonNull @NonNull com.datastax.oss.driver.api.core.CqlSession session, @NonNull @NonNull String keyspaceName, @NonNull @NonNull String tableName, @NonNull @NonNull Integer vectorDimension, @NonNull @NonNull CassandraSimilarityMetric metric) Constructor with mandatory parameters.- Parameters:
session- cassandra sessionkeyspaceName- keyspace nametableName- table namevectorDimension- vector dimensionmetric- similarity metric
-
ClusteredMetadataVectorTable
public ClusteredMetadataVectorTable(com.datastax.oss.driver.api.core.CqlSession session, String keyspaceName, String tableName, int vectorDimension) Constructor with mandatory parameters.- Parameters:
session- cassandra sessionkeyspaceName- keyspace nametableName- table namevectorDimension- vector dimension
-
-
Method Details
-
builder
Builder for the class.- Returns:
- builder for the class
-
create
public void create()Description copied from class:AbstractCassandraTableCreate table if not exist.- Specified by:
createin classAbstractCassandraTable<ClusteredMetadataVectorRecord>
-
findPartition
Find a partition.- Parameters:
partitionDd- partition id- Returns:
- list of rows
-
deletePartition
Delete a partition.- Parameters:
partitionDd- partition id
-
get
Access a record by its id- Parameters:
partitionId- partition idrowId- rowId- Returns:
- record if exists
-
delete
Access a record by its id- Parameters:
partitionId- partition idrowId- rowId
-
save
-
put
Description copied from class:AbstractCassandraTableUpsert a row of the table.- Specified by:
putin classAbstractCassandraTable<ClusteredMetadataVectorRecord>- Parameters:
row- current row
-
mapRow
Description copied from class:AbstractCassandraTableShould be table to map from a Cassandra row to a record.- Specified by:
mapRowin classAbstractCassandraTable<ClusteredMetadataVectorRecord>- Parameters:
cqlRow- current cassandra row- Returns:
- current record
-
similaritySearch
Compute Similarity Search.- Parameters:
query- current query- Returns:
- results
-