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

public abstract class AbstractCassandraTable<RECORD> extends Object
Abstract class for table management at Cassandra level.
  • Field Details

    • SAI_INDEX_CLASSNAME

      public static final String SAI_INDEX_CLASSNAME
      Class needed to create a SAI Index.
      See Also:
    • PARTITION_ID

      public static final String PARTITION_ID
      Table column names.
      See Also:
    • ROW_ID

      public static final String ROW_ID
      Table column names.
      See Also:
    • ATTRIBUTES_BLOB

      public static final String ATTRIBUTES_BLOB
      Table column names.
      See Also:
    • BODY_BLOB

      public static final String BODY_BLOB
      Table column names.
      See Also:
    • METADATA_S

      public static final String METADATA_S
      Table column names.
      See Also:
    • VECTOR

      public static final String VECTOR
      Table column names.
      See Also:
    • COLUMN_SIMILARITY

      public static final String COLUMN_SIMILARITY
      Table column names.
      See Also:
    • DEFAULT_RECORD_COUNT

      public static final int DEFAULT_RECORD_COUNT
      Default Number of item retrieved
      See Also:
    • cqlSession

      protected final com.datastax.oss.driver.api.core.CqlSession cqlSession
      Session to Cassandra.
    • keyspaceName

      protected final String keyspaceName
      Destination keyspace.
    • tableName

      protected final String tableName
      Destination table.
  • Constructor Details

    • AbstractCassandraTable

      public AbstractCassandraTable(com.datastax.oss.driver.api.core.CqlSession session, String keyspaceName, String tableName)
      Default cosntructor.
      Parameters:
      session - cassandra session
      keyspaceName - keyspace
      tableName - table Name
  • Method Details

    • create

      public abstract void create()
      Create table if not exist.
    • put

      public abstract void put(RECORD row)
      Upsert a row of the table.
      Parameters:
      row - current row
    • mapRow

      public abstract RECORD mapRow(com.datastax.oss.driver.api.core.cql.Row row)
      Should be table to map from a Cassandra row to a record.
      Parameters:
      row - current cassandra row
      Returns:
      current record
    • putAsync

      public CompletableFuture<Void> putAsync(RECORD inputRow)
      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