Package org.eso.ias.sink.ltdb
Class CassandraUtils
java.lang.Object
org.eso.ias.sink.ltdb.CassandraUtils
An helper to send commands to cassandra
- Author:
- acaproni
-
Field Summary
Modifier and TypeFieldDescriptionboolean
A flag set if the object has been closedboolean
A flag set if the conenction with Cassandra has been correctly established -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncom.datastax.driver.core.ResultSet
executeStatement
(String statement) Execute the passed statementvoid
Establish the conenction witht the database and, optionall, use the passed keyspacevoid
stop()
Close the connection with cassandra
-
Field Details
-
initialized
public volatile boolean initializedA flag set if the conenction with Cassandra has been correctly established -
closed
public volatile boolean closedA flag set if the object has been closed
-
-
Constructor Details
-
CassandraUtils
Constructor- Parameters:
contactPoints
- the contact points to connect to cassandra DB
-
-
Method Details
-
start
Establish the conenction witht the database and, optionall, use the passed keyspace- Parameters:
keyspaceOpt
- The key space- Throws:
Exception
- in case of error connecting to the cassandra DB
-
stop
Close the connection with cassandra- Throws:
Exception
-
executeStatement
Execute the passed statement- Parameters:
statement
- The not null nor empty statement to execute- Returns:
- the result set or null if the connection has been closed
-