Class CassandraDriver
java.lang.Object
org.qubership.atp.mia.repo.driver.CassandraDriver
- All Implemented Interfaces:
QueryDriver<com.datastax.driver.core.Cluster>
@Repository
public class CassandraDriver
extends Object
implements QueryDriver<com.datastax.driver.core.Cluster>
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCassandraDriver(MiaContext miaContext) Constructor.CassandraDriver(MiaContext miaContext, int expireAfter, int cleanUpTimeout) Constructor with parameters (test usage). -
Method Summary
Modifier and TypeMethodDescriptioncom.datastax.driver.core.ClusterCreate Closeable object for server.executeQuery(Server server, String query) Execute query.executeQuery(Server server, String query, int limitRecords) executeStoredProcedure(Server server, String query) Execute stored procedure.intexecuteUpdate(Server server, String query) Execute 'update'.Get driver type.longpoolSize()Gets pool size.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.qubership.atp.mia.repo.driver.QueryDriver
close, executeQuery, executeQueryAndGetFirstValue, getExecutionTimeout, initPool, initPoolCleanUp
-
Field Details
-
CASSANDRA_DATE_TIMESTAMP
- See Also:
-
cleanUpTimeout
@Value("${db.close.delay:300}") protected int cleanUpTimeout -
expiredAfter
@Value("${db.alive.length:300}") protected int expiredAfter -
executionTimeout
@Value("${db.execution.timeout:30}") protected int executionTimeout
-
-
Constructor Details
-
CassandraDriver
Constructor. -
CassandraDriver
Constructor with parameters (test usage).
-
-
Method Details
-
create
Description copied from interface:QueryDriverCreate Closeable object for server.- Specified by:
createin interfaceQueryDriver<com.datastax.driver.core.Cluster>- Parameters:
server- server- Returns:
- Closeable object
-
executeQuery
Description copied from interface:QueryDriverExecute query.- Specified by:
executeQueryin interfaceQueryDriver<com.datastax.driver.core.Cluster>- Parameters:
server- Serverquery- query- Returns:
- DbTable
-
executeQuery
- Specified by:
executeQueryin interfaceQueryDriver<com.datastax.driver.core.Cluster>
-
executeUpdate
Description copied from interface:QueryDriverExecute 'update'.- Specified by:
executeUpdatein interfaceQueryDriver<com.datastax.driver.core.Cluster>- Parameters:
server- serverquery- query- Returns:
- number affected rows
-
executeStoredProcedure
Description copied from interface:QueryDriverExecute stored procedure.- Specified by:
executeStoredProcedurein interfaceQueryDriver<com.datastax.driver.core.Cluster>- Parameters:
server- serverquery- query
-
getDriverType
Description copied from interface:QueryDriverGet driver type.- Specified by:
getDriverTypein interfaceQueryDriver<com.datastax.driver.core.Cluster>- Returns:
- driver type
-
poolSize
public long poolSize()Description copied from interface:QueryDriverGets pool size.- Specified by:
poolSizein interfaceQueryDriver<com.datastax.driver.core.Cluster>- Returns:
- pool size
-