Package com.dtsx.astra.sdk.cassio
Class AbstractCassandraTable<RECORD>
java.lang.Object
com.dtsx.astra.sdk.cassio.AbstractCassandraTable<RECORD>
- Type Parameters:
RECORD
- object in use with Cassandra
- Direct Known Subclasses:
ClusteredMetadataVectorTable
,ClusteredTable
,MetadataVectorTable
Abstract class for table management at Cassandra level.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Table column names.static final String
Table column names.static final String
Table column names.protected final com.datastax.oss.driver.api.core.CqlSession
Session to Cassandra.static final int
Default Number of item retrievedprotected final String
Destination keyspace.static final String
Table column names.static final String
Table column names.static final String
Table column names.static final String
Class needed to create a SAI Index.protected final String
Destination table.static final String
Table column names. -
Constructor Summary
ConstructorDescriptionAbstractCassandraTable
(com.datastax.oss.driver.api.core.CqlSession session, String keyspaceName, String tableName) Default cosntructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Empty a tableabstract void
create()
Create table if not exist.void
delete()
Delete the table.com.datastax.oss.driver.api.core.CqlSession
Gets cqlSessionabstract RECORD
mapRow
(com.datastax.oss.driver.api.core.cql.Row row) Should be table to map from a Cassandra row to a record.abstract void
Upsert a row of the table.Insert a row asynchronously.
-
Field Details
-
SAI_INDEX_CLASSNAME
Class needed to create a SAI Index.- See Also:
-
PARTITION_ID
Table column names.- See Also:
-
ROW_ID
Table column names.- See Also:
-
ATTRIBUTES_BLOB
Table column names.- See Also:
-
BODY_BLOB
Table column names.- See Also:
-
METADATA_S
Table column names.- See Also:
-
VECTOR
Table column names.- See Also:
-
COLUMN_SIMILARITY
Table column names.- See Also:
-
DEFAULT_RECORD_COUNT
public static final int DEFAULT_RECORD_COUNTDefault Number of item retrieved- See Also:
-
cqlSession
protected final com.datastax.oss.driver.api.core.CqlSession cqlSessionSession to Cassandra. -
keyspaceName
Destination keyspace. -
tableName
Destination table.
-
-
Constructor Details
-
Method Details
-
create
public abstract void create()Create table if not exist. -
put
Upsert a row of the table.- Parameters:
row
- current row
-
mapRow
Should be table to map from a Cassandra row to a record.- Parameters:
row
- current cassandra row- Returns:
- current record
-
putAsync
Insert a row asynchronously.- Parameters:
inputRow
- current row- Returns:
- output
-
delete
public void delete()Delete the table. -
clear
public void clear()Empty a table -
getCqlSession
public com.datastax.oss.driver.api.core.CqlSession getCqlSession()Gets cqlSession- Returns:
- value of cqlSession
-