Package com.dtsx.astra.sdk.cassio
Class ClusteredCassandraTable
java.lang.Object
com.dtsx.astra.sdk.cassio.AbstractCassandraTable<ClusteredCassandraTable.Record>
com.dtsx.astra.sdk.cassio.ClusteredCassandraTable
Table representing persistence for LangChain operations
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a row of the Table -
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
ConstructorsConstructorDescriptionClusteredCassandraTable(@NonNull com.datastax.oss.driver.api.core.CqlSession session, @NonNull String keyspaceName, @NonNull String tableName) Constructor with the mandatory parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoidCreate table if not exist.voidDelete one row.voiddeletePartition(@NonNull String partitionId) Delete Partition.Find a row by its id.findPartition(@NonNull String partitionDd) Find a partition.voidInsert Row.mapRow(@NonNull com.datastax.oss.driver.api.core.cql.Row row) Should be table to map from a Cassandra row to a record.voidUpsert a row of the table.voidUpdate the history in one go.Methods inherited from class com.dtsx.astra.sdk.cassio.AbstractCassandraTable
clear, delete, putAsync
-
Constructor Details
-
ClusteredCassandraTable
public ClusteredCassandraTable(@NonNull @NonNull com.datastax.oss.driver.api.core.CqlSession session, @NonNull @NonNull String keyspaceName, @NonNull @NonNull String tableName) Constructor with the mandatory parameters.- Parameters:
session- cassandra SessionkeyspaceName- keyspace nametableName- table name
-
-
Method Details
-
createSchema
public void createSchema()Description copied from class:AbstractCassandraTableCreate table if not exist.- Specified by:
createSchemain classAbstractCassandraTable<ClusteredCassandraTable.Record>
-
put
Upsert a row of the table.- Specified by:
putin classAbstractCassandraTable<ClusteredCassandraTable.Record>- Parameters:
row- current row
-
mapRow
public ClusteredCassandraTable.Record mapRow(@NonNull @NonNull com.datastax.oss.driver.api.core.cql.Row row) Should be table to map from a Cassandra row to a record.- Specified by:
mapRowin classAbstractCassandraTable<ClusteredCassandraTable.Record>- Parameters:
row- current cassandra row- Returns:
- current record
-
findPartition
Find a partition.- Parameters:
partitionDd- partition id- Returns:
- list of rows
-
upsertPartition
Update the history in one go.- Parameters:
rows- current rows.
-
findById
Find a row by its id.- Parameters:
partition- partition idrowId- row id- Returns:
- record if exists
-
deletePartition
Delete Partition.- Parameters:
partitionId- delete the whole partition
-
delete
Delete one row.- Parameters:
partitionId- current sessionrowId- message id
-
insert
public void insert(@NonNull @NonNull String partitionId, @NonNull @NonNull UUID rowId, @NonNull @NonNull String bodyBlob) Insert Row.- Parameters:
partitionId- partition idrowId- rowIdbodyBlob- body
-