Class CassandraClusterConnection

java.lang.Object
org.gcube.portal.databook.server.CassandraClusterConnection

public class CassandraClusterConnection extends Object
Utility class for managing Cassandra cluster connections and keyspace setup. Handles session creation, keyspace and table management, and connection configuration. Used internally by the social networking library for persistence operations.
Author:
Massimiliano Assante ISTI-CNR, Ahmed Ibrahim ISTI-CNR
  • Constructor Details

    • CassandraClusterConnection

      protected CassandraClusterConnection(boolean dropSchema) throws Exception
      Parameters:
      dropSchema - set true if you want do drop the current and set up new one the connection to cassandra cluster
      Throws:
      Exception
    • CassandraClusterConnection

      protected CassandraClusterConnection(boolean dropSchema, String infrastructureName) throws Exception
      Parameters:
      dropSchema - set true if you want to drop the current and set up new one the connection to cassandra cluster
      Throws:
      Exception
  • Method Details

    • getKeyspaceSession

      public com.datastax.oss.driver.api.core.CqlSession getKeyspaceSession()
      Returns the keyspace session. If the session is closed, it creates a new one.
      Returns:
      the keyspace session
    • SetUpKeySpaces

      public void SetUpKeySpaces(boolean dropSchema)
      Parameters:
      dropSchema - set true if you want to drop the current and set up new one the connection to cassandra cluster
    • closeSession

      public static void closeSession(com.datastax.oss.driver.api.core.CqlSession session)
    • closeConnection

      public void closeConnection()