Class CassandraQuery
- java.lang.Object
-
- org.trellisldp.ext.cassandra.query.CassandraQuery
-
- Direct Known Subclasses:
BasicContainment,BinaryQuery,Delete,Get,GetFirstMemento,GetMemento,ImmutableInsert,ImmutableRetrieve,Mementoize,Mementos,MutableInsert,Touch
public class CassandraQuery extends Object
A context for queries run against Cassandra. All requests to Cassandra should go through a subclass.
-
-
Field Summary
Fields Modifier and Type Field Description protected ConsistencyLevelconsistencyprotected CompletionStage<PreparedStatement>preparedStmtAsyncprotected StringqueryStringprotected ExecutorreadBinaryWorkersprotected CqlSessionsessionA Cassandra session for use with this query.protected ExecutorwriteWorkersWorker threads that read and write from and to Cassandra.
-
Constructor Summary
Constructors Modifier Constructor Description protectedCassandraQuery()For use with RESTeasy and CDI proxies.CassandraQuery(CqlSession session, String queryString, ConsistencyLevel consistency)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ResultSetexecuteSyncRead(BoundStatement statement)protected CompletionStage<PreparedStatement>preparedStatementAsync()
-
-
-
Field Detail
-
session
protected final CqlSession session
A Cassandra session for use with this query.
-
consistency
protected final ConsistencyLevel consistency
-
queryString
protected final String queryString
-
preparedStmtAsync
protected CompletionStage<PreparedStatement> preparedStmtAsync
-
writeWorkers
protected final Executor writeWorkers
Worker threads that read and write from and to Cassandra. Reading and writing are thereby uncoupled from threads calling into this class.
-
readBinaryWorkers
protected final Executor readBinaryWorkers
-
-
Constructor Detail
-
CassandraQuery
protected CassandraQuery()
For use with RESTeasy and CDI proxies.- API Note:
- This construtor is used by CDI runtimes that require a public, no-argument constructor. It should not be invoked directly in user code.
-
CassandraQuery
public CassandraQuery(CqlSession session, String queryString, ConsistencyLevel consistency)
- Parameters:
session- aCqlSessionto the Cassandra clusterqueryString- the CQL string for this queryconsistency- theConsistencyLevelto use for executions of this query
-
-
Method Detail
-
preparedStatementAsync
protected CompletionStage<PreparedStatement> preparedStatementAsync()
- Returns:
- the
PreparedStatementthat underlies this query
-
executeSyncRead
protected ResultSet executeSyncRead(BoundStatement statement)
- Parameters:
statement- the CQL statement to execute- Returns:
- the results of that statement
-
-