Package database.impl
Class Cassandra
java.lang.Object
database.Database
database.impl.Cassandra
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
connect()
void
Creates the keyspace if not exists.void
void
Deletes keyspace if exists previously.com.datastax.oss.driver.api.core.cql.ResultSet
execute
(com.datastax.oss.driver.api.core.cql.SimpleStatement statement) CompletionStage<com.datastax.oss.driver.api.core.cql.AsyncResultSet>
executeAsync
(com.datastax.oss.driver.api.core.cql.SimpleStatement statement) Executes a CQL query implementing semaphore strategy to throttle async writes for congestion control.CompletionStage<com.datastax.oss.driver.api.core.cql.AsyncResultSet>
executeAsyncWithSession
(com.datastax.oss.driver.api.core.cql.SimpleStatement statement) Executes a bound CQL query implementing semaphore strategy to throttle async writes for congestion control.com.datastax.oss.driver.api.core.CqlSession
Methods inherited from class database.Database
getDatabaseName, getHost, getPassword, getPort, getUsername
-
Constructor Details
-
Cassandra
-
Cassandra
-
-
Method Details
-
connect
- Specified by:
connect
in classDatabase
- Throws:
DBInitException
-
disconnect
public void disconnect()- Specified by:
disconnect
in classDatabase
-
dropDatabaseIfExists
public void dropDatabaseIfExists()Deletes keyspace if exists previously.- Specified by:
dropDatabaseIfExists
in classDatabase
-
createDatabaseIfNotExists
public void createDatabaseIfNotExists()Creates the keyspace if not exists.- Specified by:
createDatabaseIfNotExists
in classDatabase
-
execute
public com.datastax.oss.driver.api.core.cql.ResultSet execute(com.datastax.oss.driver.api.core.cql.SimpleStatement statement) -
executeAsync
public CompletionStage<com.datastax.oss.driver.api.core.cql.AsyncResultSet> executeAsync(com.datastax.oss.driver.api.core.cql.SimpleStatement statement) Executes a CQL query implementing semaphore strategy to throttle async writes for congestion control. See also this and this.- Specified by:
executeAsync
in classDatabase
- Parameters:
statement
- the CQL query to execute (that can be anyStatement
).- Returns:
- a
CompletionStage
.
-
executeAsyncWithSession
public CompletionStage<com.datastax.oss.driver.api.core.cql.AsyncResultSet> executeAsyncWithSession(com.datastax.oss.driver.api.core.cql.SimpleStatement statement) Executes a bound CQL query implementing semaphore strategy to throttle async writes for congestion control. See also this and this.- Specified by:
executeAsyncWithSession
in classDatabase
- Parameters:
statement
- the CQL query to execute (that can be anyStatement
).- Returns:
- a
CompletionStage
.
-
getSession
public com.datastax.oss.driver.api.core.CqlSession getSession()- Specified by:
getSession
in classDatabase
-