Package com.dtsx.astra.sdk.cassio
Class ClusteredTable
java.lang.Object
com.dtsx.astra.sdk.cassio.AbstractCassandraTable<ClusteredRecord>
com.dtsx.astra.sdk.cassio.ClusteredTable
Table representing persistence for LangChain operations
-
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
ConstructorsConstructorDescriptionClusteredTable(@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()Create 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.voidput(@NonNull ClusteredRecord row) Upsert a row of the table.voidupsertPartition(List<ClusteredRecord> rows) Update the history in one go.Methods inherited from class com.dtsx.astra.sdk.cassio.AbstractCassandraTable
clear, delete, getCqlSession, putAsync
-
Constructor Details
-
ClusteredTable
public ClusteredTable(@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
-
create
public void create()Create table if not exist.- Specified by:
createin classAbstractCassandraTable<ClusteredRecord>
-
put
Upsert a row of the table.- Specified by:
putin classAbstractCassandraTable<ClusteredRecord>- Parameters:
row- current row
-
mapRow
Should be table to map from a Cassandra row to a record.- Specified by:
mapRowin classAbstractCassandraTable<ClusteredRecord>- 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
-