Class CassandraDb
java.lang.Object
kieker.extension.cassandra.writer.CassandraDb
- Since:
- 1.16
- Author:
- Armin Moebius, Sven Ulrich, Reiner Jung
-
Constructor Summary
ConstructorsConstructorDescriptionCassandraDb(String keyspace, List<InetSocketAddress> contactPoints, String tablePrefix, boolean dropTables) Creates a new instance of this class using the given parameter. -
Method Summary
Modifier and TypeMethodDescriptionbooleanconnect()Establishes a connection to the database.voidCloses all open connections to the database.com.datastax.oss.driver.api.core.cql.BoundStatementgetBoundStatement(com.datastax.oss.driver.api.core.cql.PreparedStatement statement) Returns a BoundStatement from the given String.voidinsert(IMonitoringRecord record, String benchmarkId) Insert a record into the database.
-
Constructor Details
-
CassandraDb
public CassandraDb(String keyspace, List<InetSocketAddress> contactPoints, String tablePrefix, boolean dropTables) Creates a new instance of this class using the given parameter.- Parameters:
keyspace-contactPoints-tablePrefix-dropTables-
-
-
Method Details
-
connect
public boolean connect()Establishes a connection to the database.- Returns:
- true when the connection could be established
-
disconnect
public void disconnect()Closes all open connections to the database. -
insert
Insert a record into the database.- Parameters:
record- the recordbenchmarkId- the current benchmarkId- Throws:
MonitoringRecordException- failed to insert the record or creating and registring the record table in the first place.
-
getBoundStatement
public com.datastax.oss.driver.api.core.cql.BoundStatement getBoundStatement(com.datastax.oss.driver.api.core.cql.PreparedStatement statement) Returns a BoundStatement from the given String. Uses the default Session to the keyspace.- Parameters:
statement-- Returns:
- bound statement
-