Package org.gcube.portal.databook.server
Class CassandraClusterConnection
java.lang.Object
org.gcube.portal.databook.server.CassandraClusterConnection
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 Summary
ConstructorsModifierConstructorDescriptionprotectedCassandraClusterConnection(boolean dropSchema) protectedCassandraClusterConnection(boolean dropSchema, String infrastructureName) -
Method Summary
Modifier and TypeMethodDescriptionvoidstatic voidcloseSession(com.datastax.oss.driver.api.core.CqlSession session) com.datastax.oss.driver.api.core.CqlSessionReturns the keyspace session.voidSetUpKeySpaces(boolean dropSchema)
-
Constructor Details
-
CassandraClusterConnection
- 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()
-