public interface CqlOperations
Modifier and Type | Method and Description |
---|---|
long |
count(CqlIdentifier tableName)
Counts all rows for given table
|
long |
count(String tableName)
Counts all rows for given table
|
List<RingMember> |
describeRing()
Describe the current Ring.
|
<T> Collection<T> |
describeRing(HostMapper<T> hostMapper)
Describe the current Ring.
|
com.datastax.driver.core.ResultSet |
execute(AlterKeyspaceSpecification specification)
Convenience method to convert the given specification to CQL and execute it.
|
com.datastax.driver.core.ResultSet |
execute(AlterTableSpecification specification)
Convenience method to convert the given specification to CQL and execute it.
|
void |
execute(com.datastax.driver.core.querybuilder.Batch batch)
Executes the supplied Batch Query and returns nothing.
|
com.datastax.driver.core.ResultSet |
execute(CreateIndexSpecification specification)
Convenience method to convert the given specification to CQL and execute it.
|
com.datastax.driver.core.ResultSet |
execute(CreateKeyspaceSpecification specification)
Convenience method to convert the given specification to CQL and execute it.
|
com.datastax.driver.core.ResultSet |
execute(CreateTableSpecification specification)
Convenience method to convert the given specification to CQL and execute it.
|
void |
execute(com.datastax.driver.core.querybuilder.Delete delete)
Executes the supplied Delete Query and returns nothing.
|
com.datastax.driver.core.ResultSet |
execute(DropIndexSpecification specification)
Convenience method to convert the given specification to CQL and execute it.
|
com.datastax.driver.core.ResultSet |
execute(DropKeyspaceSpecification specification)
Convenience method to convert the given specification to CQL and execute it.
|
com.datastax.driver.core.ResultSet |
execute(DropTableSpecification specification)
Convenience method to convert the given specification to CQL and execute it.
|
void |
execute(com.datastax.driver.core.querybuilder.Insert insert)
Executes the supplied Insert Query and returns nothing.
|
<T> T |
execute(PreparedStatementCreator psc,
PreparedStatementCallback<T> action)
Uses the provided
PreparedStatementCreator to create a PreparedStatement in the current
Session , then passes that PreparedStatement to the given PreparedStatementCallback . |
<T> T |
execute(SessionCallback<T> sessionCallback)
Executes the supplied
SessionCallback in the current Template Session. |
void |
execute(com.datastax.driver.core.Statement query)
Executes the supplied Query and returns nothing.
|
void |
execute(String cql)
Executes the supplied CQL Query and returns nothing.
|
<T> T |
execute(String cql,
PreparedStatementCallback<T> action)
Creates and caches a
PreparedStatement from the given CQL, invokes the PreparedStatementCallback
with that PreparedStatement , then returns the value returned by the PreparedStatementCallback . |
void |
execute(String cql,
QueryOptions options)
Executes the supplied CQL Query and returns nothing.
|
void |
execute(com.datastax.driver.core.querybuilder.Truncate truncate)
Executes the supplied Truncate Query and returns nothing.
|
void |
execute(com.datastax.driver.core.querybuilder.Update update)
Executes the supplied Update Query and returns nothing.
|
void |
executeAsynchronously(com.datastax.driver.core.querybuilder.Batch batch)
Executes the supplied CQL Batch Asynchronously and returns nothing.
|
void |
executeAsynchronously(com.datastax.driver.core.querybuilder.Delete delete)
Executes the supplied CQL Delete Asynchronously and returns nothing.
|
void |
executeAsynchronously(com.datastax.driver.core.querybuilder.Insert insert)
Executes the supplied CQL Insert Asynchronously and returns nothing.
|
void |
executeAsynchronously(com.datastax.driver.core.Statement query)
Executes the supplied CQL Query Asynchronously and returns nothing.
|
void |
executeAsynchronously(com.datastax.driver.core.Statement query,
AsynchronousQueryListener listener)
Executes the supplied CQL Query Asynchronously and returns nothing.
|
void |
executeAsynchronously(com.datastax.driver.core.Statement query,
AsynchronousQueryListener listener,
Executor executor)
Executes the supplied CQL Query Asynchronously and returns nothing.
|
void |
executeAsynchronously(com.datastax.driver.core.Statement query,
Runnable runnable)
Executes the supplied CQL Query Asynchronously and returns nothing.
|
void |
executeAsynchronously(com.datastax.driver.core.Statement query,
Runnable runnable,
Executor executor)
Executes the supplied CQL Query Asynchronously and returns nothing.
|
void |
executeAsynchronously(String cql)
Executes the supplied Query Asynchronously and returns nothing.
|
void |
executeAsynchronously(String cql,
AsynchronousQueryListener listener)
Executes the supplied Query Asynchronously and returns nothing.
|
void |
executeAsynchronously(String cql,
AsynchronousQueryListener listener,
Executor executor)
Executes the supplied Query Asynchronously and returns nothing.
|
void |
executeAsynchronously(String cql,
QueryOptions options)
Executes the supplied Query Asynchronously and returns nothing.
|
void |
executeAsynchronously(String cql,
Runnable listener)
Executes the supplied Query Asynchronously and returns nothing.
|
void |
executeAsynchronously(String cql,
Runnable listener,
Executor executor)
Executes the supplied Query Asynchronously and returns nothing.
|
void |
executeAsynchronously(com.datastax.driver.core.querybuilder.Truncate truncate)
Executes the supplied CQL Truncate Asynchronously and returns nothing.
|
void |
executeAsynchronously(com.datastax.driver.core.querybuilder.Update update)
Executes the supplied CQL Update Asynchronously and returns nothing.
|
com.datastax.driver.core.Session |
getSession()
Get the current Session used for operations in the implementing class.
|
void |
ingest(String cql,
List<List<?>> rows)
This is an operation designed for high performance writes.
|
void |
ingest(String cql,
List<List<?>> rows,
WriteOptions options)
This is an operation designed for high performance writes.
|
void |
ingest(String cql,
Object[][] rows)
This is an operation designed for high performance writes.
|
void |
ingest(String cql,
Object[][] rows,
WriteOptions options)
This is an operation designed for high performance writes.
|
void |
ingest(String cql,
RowIterator rowIterator)
This is an operation designed for high performance writes.
|
void |
ingest(String cql,
RowIterator rowIterator,
WriteOptions options)
This is an operation designed for high performance writes.
|
void |
process(com.datastax.driver.core.ResultSet resultSet,
RowCallbackHandler rch)
Processes the ResultSet through the RowCallbackHandler and return nothing.
|
<T> List<T> |
process(com.datastax.driver.core.ResultSet resultSet,
RowMapper<T> rowMapper)
Processes the ResultSet through the RowMapper and returns the List of mapped Rows.
|
<T> List<T> |
processList(com.datastax.driver.core.ResultSet resultSet,
Class<T> elementType)
Process a ResultSet and convert the first column of the results to a List.
|
List<Map<String,Object>> |
processListOfMap(com.datastax.driver.core.ResultSet resultSet)
Process a ResultSet and convert it to a List of Maps with column/value.
|
Map<String,Object> |
processMap(com.datastax.driver.core.ResultSet resultSet)
Process a ResultSet with ONE Row and convert to a Map.
|
<T> T |
processOne(com.datastax.driver.core.ResultSet resultSet,
Class<T> requiredType)
Process a ResultSet, trying to convert the first columns of the first Row to Class
|
<T> T |
processOne(com.datastax.driver.core.ResultSet resultSet,
RowMapper<T> rowMapper)
Process a ResultSet through a RowMapper.
|
<T> T |
query(PreparedStatementCreator psc,
PreparedStatementBinder psb,
ResultSetExtractor<T> rse)
Uses the provided PreparedStatementCreator to prepare a new Session call.
|
<T> T |
query(PreparedStatementCreator psc,
PreparedStatementBinder psb,
ResultSetExtractor<T> rse,
QueryOptions options)
Uses the provided PreparedStatementCreator to prepare a new Session call.
|
void |
query(PreparedStatementCreator psc,
PreparedStatementBinder psb,
RowCallbackHandler rch)
Uses the provided PreparedStatementCreator to prepare a new Session call.
|
void |
query(PreparedStatementCreator psc,
PreparedStatementBinder psb,
RowCallbackHandler rch,
QueryOptions options)
Uses the provided PreparedStatementCreator to prepare a new Session call.
|
<T> List<T> |
query(PreparedStatementCreator psc,
PreparedStatementBinder psb,
RowMapper<T> rowMapper)
Uses the provided PreparedStatementCreator to prepare a new Session call.
|
<T> List<T> |
query(PreparedStatementCreator psc,
PreparedStatementBinder psb,
RowMapper<T> rowMapper,
QueryOptions options)
Uses the provided PreparedStatementCreator to prepare a new Session call.
|
<T> T |
query(PreparedStatementCreator psc,
ResultSetExtractor<T> rse)
Uses the provided PreparedStatementCreator to prepare a new Session call.
|
<T> T |
query(PreparedStatementCreator psc,
ResultSetExtractor<T> rse,
QueryOptions options)
Uses the provided PreparedStatementCreator to prepare a new Session call.
|
void |
query(PreparedStatementCreator psc,
RowCallbackHandler rch)
Uses the provided PreparedStatementCreator to prepare a new Session call.
|
void |
query(PreparedStatementCreator psc,
RowCallbackHandler rch,
QueryOptions options)
Uses the provided PreparedStatementCreator to prepare a new Session call.
|
<T> List<T> |
query(PreparedStatementCreator psc,
RowMapper<T> rowMapper)
Uses the provided PreparedStatementCreator to prepare a new Session call.
|
<T> List<T> |
query(PreparedStatementCreator psc,
RowMapper<T> rowMapper,
QueryOptions options)
Uses the provided PreparedStatementCreator to prepare a new Session call.
|
com.datastax.driver.core.ResultSet |
query(com.datastax.driver.core.querybuilder.Select select)
Executes the provided Select query and returns the
ResultSet . |
<T> T |
query(com.datastax.driver.core.querybuilder.Select select,
ResultSetExtractor<T> rse)
Executes the provided Select Query, and extracts the results with the ResultSetExtractor.
|
void |
query(com.datastax.driver.core.querybuilder.Select select,
RowCallbackHandler rch)
Executes the provided Select Query, and then processes the results with the
RowCallbackHandler . |
<T> List<T> |
query(com.datastax.driver.core.querybuilder.Select select,
RowMapper<T> rowMapper)
Executes the provided Select Query, and maps all Rows returned with the supplied RowMapper.
|
com.datastax.driver.core.ResultSet |
query(String cql)
Executes the provided CQL query and returns the
ResultSet . |
<T> T |
query(String cql,
PreparedStatementBinder psb,
ResultSetExtractor<T> rse)
Converts the CQL provided into a
CachedPreparedStatementCreator . |
<T> T |
query(String cql,
PreparedStatementBinder psb,
ResultSetExtractor<T> rse,
QueryOptions options)
Converts the CQL provided into a
CachedPreparedStatementCreator . |
void |
query(String cql,
PreparedStatementBinder psb,
RowCallbackHandler rch)
Converts the CQL provided into a
CachedPreparedStatementCreator . |
void |
query(String cql,
PreparedStatementBinder psb,
RowCallbackHandler rch,
QueryOptions options)
Converts the CQL provided into a
CachedPreparedStatementCreator . |
<T> List<T> |
query(String cql,
PreparedStatementBinder psb,
RowMapper<T> rowMapper)
Converts the CQL provided into a
CachedPreparedStatementCreator . |
<T> List<T> |
query(String cql,
PreparedStatementBinder psb,
RowMapper<T> rowMapper,
QueryOptions options)
Converts the CQL provided into a
CachedPreparedStatementCreator . |
com.datastax.driver.core.ResultSet |
query(String cql,
QueryOptions options)
Executes the provided CQL query with the given
QueryOptions and returns the ResultSet . |
<T> T |
query(String cql,
ResultSetExtractor<T> rse)
Executes the provided CQL Query, and extracts the results with the ResultSetExtractor.
|
<T> T |
query(String cql,
ResultSetExtractor<T> rse,
QueryOptions options)
Executes the provided CQL Query, and extracts the results with the ResultSetExtractor.
|
void |
query(String cql,
RowCallbackHandler rch)
Executes the provided CQL Query, and then processes the results with the
RowCallbackHandler . |
void |
query(String cql,
RowCallbackHandler rch,
QueryOptions options)
Executes the provided CQL Query, and then processes the results with the
RowCallbackHandler . |
<T> List<T> |
query(String cql,
RowMapper<T> rowMapper)
Executes the provided CQL Query, and maps all Rows returned with the supplied RowMapper.
|
<T> List<T> |
query(String cql,
RowMapper<T> rowMapper,
QueryOptions options)
Executes the provided CQL Query, and maps all Rows returned with the supplied RowMapper.
|
com.datastax.driver.core.ResultSetFuture |
queryAsynchronously(com.datastax.driver.core.querybuilder.Select select)
Executes the provided CQL Select and returns the ResultSetFuture for user processing.
|
void |
queryAsynchronously(com.datastax.driver.core.querybuilder.Select select,
AsynchronousQueryListener listener)
Executes the provided CQL Select with the provided listener.
|
void |
queryAsynchronously(com.datastax.driver.core.querybuilder.Select select,
AsynchronousQueryListener listener,
Executor executor)
Executes the provided Select Query with the provided listener and executor.
|
void |
queryAsynchronously(com.datastax.driver.core.querybuilder.Select select,
Runnable listener)
Executes the provided CQL Select with the provided
Runnable , which is started after the query has
completed. |
void |
queryAsynchronously(com.datastax.driver.core.querybuilder.Select select,
Runnable listener,
Executor executor)
Executes the provided CQL Select with the provided Executor and Runnable implementations.
|
com.datastax.driver.core.ResultSetFuture |
queryAsynchronously(String cql)
Executes the provided CQL Query and returns the ResultSetFuture for user processing.
|
void |
queryAsynchronously(String cql,
AsynchronousQueryListener listener)
Executes the provided CQL Query with the provided listener.
|
void |
queryAsynchronously(String cql,
AsynchronousQueryListener listener,
Executor executor)
Executes the provided CQL Query with the provided listener and executor.
|
void |
queryAsynchronously(String cql,
AsynchronousQueryListener listener,
QueryOptions options)
Executes the provided CQL Query with the provided Listener and Query Options.
|
void |
queryAsynchronously(String cql,
AsynchronousQueryListener listener,
QueryOptions options,
Executor executor)
Executes the provided CQL Query with the provided Listener, Executor and Query Options.
|
com.datastax.driver.core.ResultSetFuture |
queryAsynchronously(String cql,
QueryOptions options)
Executes the provided CQL Query and returns the ResultSetFuture for user processing.
|
<T> T |
queryAsynchronously(String cql,
ResultSetExtractor<T> rse,
Long timeout,
TimeUnit timeUnit)
Executes the provided CQL Query, and extracts the results with the ResultSetExtractor.
|
<T> T |
queryAsynchronously(String cql,
ResultSetExtractor<T> rse,
Long timeout,
TimeUnit timeUnit,
QueryOptions options)
Executes the provided CQL Query, and extracts the results with the ResultSetExtractor.
|
void |
queryAsynchronously(String cql,
Runnable listener)
Executes the provided CQL Query with the provided
Runnable , which is started after the query has completed. |
void |
queryAsynchronously(String cql,
Runnable listener,
Executor executor)
Executes the provided CQL Query with the provided Executor and Runnable implementations.
|
void |
queryAsynchronously(String cql,
Runnable listener,
QueryOptions options)
Executes the provided CQL Query with the Runnable implementations using the Query Options.
|
void |
queryAsynchronously(String cql,
Runnable listener,
QueryOptions options,
Executor executor)
Executes the provided CQL Query with the provided Executor and Runnable implementations.
|
<T> List<T> |
queryForList(com.datastax.driver.core.querybuilder.Select select,
Class<T> elementType)
Executes the provided Select Query and returns all values in the first column of the Results as a List of the Type
in the second argument.
|
<T> List<T> |
queryForList(String cql,
Class<T> elementType)
Executes the provided CQL and returns all values in the first column of the Results as a List of the Type in the
second argument.
|
List<Map<String,Object>> |
queryForListOfMap(com.datastax.driver.core.querybuilder.Select select)
Executes the provided Select Query and converts the results to a basic List of Maps.
|
List<Map<String,Object>> |
queryForListOfMap(String cql)
Executes the provided CQL and converts the results to a basic List of Maps.
|
Map<String,Object> |
queryForMap(com.datastax.driver.core.querybuilder.Select select)
Executes the provided Select Query and maps ONE Row to a basic Map of Strings and Objects.
|
Map<String,Object> |
queryForMap(String cql)
Executes the provided CQL Query and maps ONE Row to a basic Map of Strings and Objects.
|
<T> T |
queryForObject(com.datastax.driver.core.querybuilder.Select select,
Class<T> requiredType)
Executes the provided Select query and tries to return the first column of the first Row as a Class
|
<T> T |
queryForObject(com.datastax.driver.core.querybuilder.Select select,
RowMapper<T> rowMapper)
Executes the provided Select Query, and maps ONE Row returned with the supplied RowMapper.
|
<T> T |
queryForObject(String cql,
Class<T> requiredType)
Executes the provided query and tries to return the first column of the first Row as a Class
|
<T> T |
queryForObject(String cql,
RowMapper<T> rowMapper)
Executes the provided CQL Query, and maps ONE Row returned with the supplied RowMapper.
|
void |
truncate(CqlIdentifier tableName)
Delete all rows in the table
|
void |
truncate(String tableName)
Delete all rows in the table
|
<T> T execute(SessionCallback<T> sessionCallback) throws DataAccessException
SessionCallback
in the current Template Session. The implementation of
SessionCallback can decide whether or not to execute()
or executeAsync()
the operation.sessionCallback
- DataAccessException
void execute(String cql) throws DataAccessException
cql
- DataAccessException
void execute(String cql, QueryOptions options) throws DataAccessException
cql
- options
- may be nullDataAccessException
void execute(com.datastax.driver.core.Statement query) throws DataAccessException
query
- The Statement
to executeDataAccessException
void execute(com.datastax.driver.core.querybuilder.Delete delete) throws DataAccessException
query
- The Delete
to executeDataAccessException
void execute(com.datastax.driver.core.querybuilder.Insert insert) throws DataAccessException
query
- The Insert
to executeDataAccessException
void execute(com.datastax.driver.core.querybuilder.Update update) throws DataAccessException
query
- The Update
to executeDataAccessException
void execute(com.datastax.driver.core.querybuilder.Batch batch) throws DataAccessException
query
- The Batch
to executeDataAccessException
void execute(com.datastax.driver.core.querybuilder.Truncate truncate) throws DataAccessException
query
- The Truncate
to executeDataAccessException
void executeAsynchronously(String cql) throws DataAccessException
cql
- The CQL String to executeDataAccessException
void executeAsynchronously(String cql, QueryOptions options) throws DataAccessException
cql
- The CQL String to executeoptions
- The QueryOptions
to use. Only applies to cql statements that can use QueryOptions.DataAccessException
void executeAsynchronously(String cql, Runnable listener) throws DataAccessException
cql
- The CQL String to executelistener
- The Runnable
to register with the ResultSetFuture
DataAccessException
for Reads
void executeAsynchronously(String cql, Runnable listener, Executor executor) throws DataAccessException
cql
- The CQL String to executelistener
- The Runnable
to register with the ResultSetFuture
executor
- The Executor
to regsiter with the ResultSetFuture
DataAccessException
for Reads
void executeAsynchronously(String cql, AsynchronousQueryListener listener) throws DataAccessException
cql
- The CQL String to executelistener
- The AsynchronousQueryListener
to register with the ResultSetFuture
DataAccessException
for Reads
void executeAsynchronously(String cql, AsynchronousQueryListener listener, Executor executor) throws DataAccessException
cql
- The CQL String to executelistener
- The AsynchronousQueryListener
to register with the ResultSetFuture
executor
- The Executor
to regsiter with the ResultSetFuture
DataAccessException
for Reads
void executeAsynchronously(com.datastax.driver.core.querybuilder.Truncate truncate) throws DataAccessException
query
- The Truncate
to executeDataAccessException
void executeAsynchronously(com.datastax.driver.core.querybuilder.Delete delete) throws DataAccessException
query
- The Delete
to executeDataAccessException
void executeAsynchronously(com.datastax.driver.core.querybuilder.Insert insert) throws DataAccessException
query
- The Insert
to executeDataAccessException
void executeAsynchronously(com.datastax.driver.core.querybuilder.Update update) throws DataAccessException
query
- The Update
to executeDataAccessException
void executeAsynchronously(com.datastax.driver.core.querybuilder.Batch batch) throws DataAccessException
query
- The Batch
to executeDataAccessException
void executeAsynchronously(com.datastax.driver.core.Statement query) throws DataAccessException
query
- The Statement
to executeDataAccessException
void executeAsynchronously(com.datastax.driver.core.Statement query, Runnable runnable) throws DataAccessException
query
- The Statement
to executeDataAccessException
void executeAsynchronously(com.datastax.driver.core.Statement query, AsynchronousQueryListener listener) throws DataAccessException
query
- The Statement
to executeDataAccessException
void executeAsynchronously(com.datastax.driver.core.Statement query, Runnable runnable, Executor executor) throws DataAccessException
query
- The Statement
to executeDataAccessException
void executeAsynchronously(com.datastax.driver.core.Statement query, AsynchronousQueryListener listener, Executor executor) throws DataAccessException
query
- The Statement
to executeDataAccessException
<T> T queryAsynchronously(String cql, ResultSetExtractor<T> rse, Long timeout, TimeUnit timeUnit)
cql
- The Queryrse
- The implementation for extracting the ResultSettimeout
- Time to wait for resultstimeUnit
- Time unit to wait for results<T> T queryAsynchronously(String cql, ResultSetExtractor<T> rse, Long timeout, TimeUnit timeUnit, QueryOptions options)
cql
- The Queryrse
- The implementation for extracting the ResultSettimeout
- Time to wait for resultstimeUnit
- Time unit to wait for resultsoptions
- Query Optionscom.datastax.driver.core.ResultSetFuture queryAsynchronously(String cql)
cql
- The Querycom.datastax.driver.core.ResultSetFuture queryAsynchronously(com.datastax.driver.core.querybuilder.Select select)
cql
- The Select
com.datastax.driver.core.ResultSetFuture queryAsynchronously(String cql, QueryOptions options)
cql
- The Queryoptions
- Query Optionsvoid queryAsynchronously(String cql, Runnable listener)
Runnable
, which is started after the query has completed.
A more useful method than this one is queryAsynchronously(String, AsynchronousQueryListener)
, where you're
given the ResultSetFuture
after the query has been executed.cql
- The Querylistener
- Runnable
listener for handling the query in a separate threadqueryAsynchronously(String, AsynchronousQueryListener)
void queryAsynchronously(com.datastax.driver.core.querybuilder.Select select, Runnable listener)
Runnable
, which is started after the query has
completed.
A more useful method than this one is queryAsynchronously(Select, AsynchronousQueryListener)
, where you're
given the ResultSetFuture
after the query has been executed.select
- The Select Querylistener
- Runnable
listener for handling the query in a separate threadqueryAsynchronously(Select, AsynchronousQueryListener)
void queryAsynchronously(String cql, AsynchronousQueryListener listener)
Runnable
. The AsynchronousQueryListener
gives you access to the ResultSetFuture
once the
query is completed for optimal flexibility.cql
- The Querylistener
- AsynchronousQueryListener
for handling the query's ResultSetFuture
in a separate
threadvoid queryAsynchronously(com.datastax.driver.core.querybuilder.Select select, AsynchronousQueryListener listener)
Runnable
. The AsynchronousQueryListener
gives you access to the ResultSetFuture
once the
query is completed for optimal flexibility.select
- The Selectlistener
- AsynchronousQueryListener
for handling the query's ResultSetFuture
in a separate
threadvoid queryAsynchronously(String cql, Runnable listener, QueryOptions options)
cql
- The Queryoptions
- Query Optionlistener
- Runnable Listener for handling the query in a separate threadvoid queryAsynchronously(String cql, AsynchronousQueryListener listener, QueryOptions options)
AsynchronousQueryListener
gives you access to the
ResultSetFuture
once the query is completed for optimal flexibility.cql
- The Queryoptions
- Query Optionlistener
- Runnable Listener for handling the query in a separate threadvoid queryAsynchronously(String cql, Runnable listener, Executor executor)
cql
- The Querylistener
- Runnable Listener for handling the query in a separate threadexecutor
- To execute the Runnable Listenervoid queryAsynchronously(com.datastax.driver.core.querybuilder.Select select, Runnable listener, Executor executor)
select
- The Select Querylistener
- Runnable Listener for handling the query in a separate threadexecutor
- To execute the Runnable Listenervoid queryAsynchronously(String cql, AsynchronousQueryListener listener, Executor executor)
AsynchronousQueryListener
gives you access to the ResultSetFuture
once the query is completed for optimal flexibility.cql
- The Queryoptions
- Query Optionlistener
- Runnable Listener for handling the query in a separate threadexecutor
- To execute the Runnable Listenervoid queryAsynchronously(com.datastax.driver.core.querybuilder.Select select, AsynchronousQueryListener listener, Executor executor)
AsynchronousQueryListener
gives you access to the ResultSetFuture
once the query is completed for optimal flexibility.select
- The Select Querylistener
- Runnable Listener for handling the query in a separate threadexecutor
- To execute the Runnable Listenervoid queryAsynchronously(String cql, Runnable listener, QueryOptions options, Executor executor)
cql
- The Queryoptions
- Query Optionlistener
- Runnable Listener for handling the query in a separate threadexecutor
- To execute the Runnable Listenervoid queryAsynchronously(String cql, AsynchronousQueryListener listener, QueryOptions options, Executor executor)
AsynchronousQueryListener
gives you access to the
ResultSetFuture
once the query is completed for optimal flexibility.cql
- listener
- options
- executor
- com.datastax.driver.core.ResultSet query(String cql)
ResultSet
.cql
- The queryResultSet
com.datastax.driver.core.ResultSet query(com.datastax.driver.core.querybuilder.Select select)
ResultSet
.select
- The Select QueryResultSet
com.datastax.driver.core.ResultSet query(String cql, QueryOptions options)
QueryOptions
and returns the ResultSet
.cql
- The queryoptions
- The QueryOptions
; may be null.ResultSet
<T> T query(String cql, ResultSetExtractor<T> rse) throws DataAccessException
cql
- The Queryrse
- The implementation for extracting the ResultSetDataAccessException
<T> T query(com.datastax.driver.core.querybuilder.Select select, ResultSetExtractor<T> rse) throws DataAccessException
select
- The SelectQueryrse
- The implementation for extracting the ResultSetDataAccessException
<T> T query(String cql, ResultSetExtractor<T> rse, QueryOptions options) throws DataAccessException
cql
- The Queryrse
- The implementation for extracting the ResultSetoptions
- Query OptionsDataAccessException
void query(String cql, RowCallbackHandler rch) throws DataAccessException
RowCallbackHandler
.cql
- The Queryrch
- The implementation for processing the rows returned.DataAccessException
void query(com.datastax.driver.core.querybuilder.Select select, RowCallbackHandler rch) throws DataAccessException
RowCallbackHandler
.select
- The Select Queryrch
- The implementation for processing the rows returned.DataAccessException
void query(String cql, RowCallbackHandler rch, QueryOptions options) throws DataAccessException
RowCallbackHandler
.cql
- The Queryrch
- The implementation for processing the rows returned.options
- Query Options ObjectDataAccessException
void process(com.datastax.driver.core.ResultSet resultSet, RowCallbackHandler rch) throws DataAccessException
resultSet
- Results to processrch
- RowCallbackHandler with the processing implementationDataAccessException
<T> List<T> query(String cql, RowMapper<T> rowMapper) throws DataAccessException
cql
- The QueryrowMapper
- The implementation for mapping all rowsDataAccessException
<T> List<T> query(com.datastax.driver.core.querybuilder.Select select, RowMapper<T> rowMapper) throws DataAccessException
select
- The Select QueryrowMapper
- The implementation for mapping all rowsDataAccessException
<T> List<T> query(String cql, RowMapper<T> rowMapper, QueryOptions options) throws DataAccessException
cql
- The QueryrowMapper
- The implementation for mapping all rowsoptions
- Query Options ObjectDataAccessException
<T> List<T> process(com.datastax.driver.core.ResultSet resultSet, RowMapper<T> rowMapper) throws DataAccessException
resultSet
- Results to processrowMapper
- RowMapper with the processing implementationDataAccessException
<T> T queryForObject(String cql, RowMapper<T> rowMapper) throws DataAccessException
This expects only ONE row to be returned. More than one Row will cause an Exception to be thrown.
cql
- The QueryrowMapper
- The implementation for convert the Row to DataAccessException
<T> T queryForObject(com.datastax.driver.core.querybuilder.Select select, RowMapper<T> rowMapper) throws DataAccessException
This expects only ONE row to be returned. More than one Row will cause an Exception to be thrown.
select
- The Select QueryrowMapper
- The implementation for convert the Row to DataAccessException
<T> T processOne(com.datastax.driver.core.ResultSet resultSet, RowMapper<T> rowMapper) throws DataAccessException
resultSet
- rowMapper
- DataAccessException
<T> T queryForObject(String cql, Class<T> requiredType) throws DataAccessException
cql
- The QueryrequiredType
- Valid Class that Cassandra Data Types can be converted to.DataAccessException
<T> T queryForObject(com.datastax.driver.core.querybuilder.Select select, Class<T> requiredType) throws DataAccessException
select
- The Select QueryrequiredType
- Valid Class that Cassandra Data Types can be converted to.DataAccessException
<T> T processOne(com.datastax.driver.core.ResultSet resultSet, Class<T> requiredType) throws DataAccessException
resultSet
- requiredType
- DataAccessException
Map<String,Object> queryForMap(String cql) throws DataAccessException
cql
- The QueryDataAccessException
Map<String,Object> queryForMap(com.datastax.driver.core.querybuilder.Select select) throws DataAccessException
select
- The Select QueryDataAccessException
Map<String,Object> processMap(com.datastax.driver.core.ResultSet resultSet) throws DataAccessException
resultSet
- DataAccessException
<T> List<T> queryForList(String cql, Class<T> elementType) throws DataAccessException
cql
- The QueryelementType
- Type to cast the data values toDataAccessException
<T> List<T> queryForList(com.datastax.driver.core.querybuilder.Select select, Class<T> elementType) throws DataAccessException
select
- The Select QueryelementType
- Type to cast the data values toDataAccessException
<T> List<T> processList(com.datastax.driver.core.ResultSet resultSet, Class<T> elementType) throws DataAccessException
resultSet
- elementType
- DataAccessException
List<Map<String,Object>> queryForListOfMap(String cql) throws DataAccessException
cql
- The QueryDataAccessException
List<Map<String,Object>> queryForListOfMap(com.datastax.driver.core.querybuilder.Select select) throws DataAccessException
select
- The Select QueryDataAccessException
List<Map<String,Object>> processListOfMap(com.datastax.driver.core.ResultSet resultSet) throws DataAccessException
resultSet
- DataAccessException
<T> T execute(String cql, PreparedStatementCallback<T> action) throws DataAccessException
PreparedStatement
from the given CQL, invokes the PreparedStatementCallback
with that PreparedStatement
, then returns the value returned by the PreparedStatementCallback
.cql
- The CQL statement from which to create and cache a PreparedStatement
action
- The callback that is given the PreparedStatement
PreparedStatementCallback
DataAccessException
<T> T execute(PreparedStatementCreator psc, PreparedStatementCallback<T> action) throws DataAccessException
PreparedStatementCreator
to create a PreparedStatement
in the current
Session
, then passes that PreparedStatement
to the given PreparedStatementCallback
.psc
- The PreparedStatementCreator
action
- The callback that receives the PreparedStatement
PreparedStatementCallback
DataAccessException
<T> T query(String cql, PreparedStatementBinder psb, ResultSetExtractor<T> rse) throws DataAccessException
CachedPreparedStatementCreator
. Then, the PreparedStatementBinder will
bind its values to the bind variables in the provided CQL String. The results of the PreparedStatement are
processed with the ResultSetExtractor implementation provided by the Application Code. The can return any object,
including a List of Objects to support the ResultSet processing.cql
- The Query to Preparepsb
- The Binding implementationrse
- The implementation for extracting the results of the query.DataAccessException
<T> T query(String cql, PreparedStatementBinder psb, ResultSetExtractor<T> rse, QueryOptions options) throws DataAccessException
CachedPreparedStatementCreator
. Then, the PreparedStatementBinder will
bind its values to the bind variables in the provided CQL String. The results of the PreparedStatement are
processed with the ResultSetExtractor implementation provided by the Application Code. The can return any object,
including a List of Objects to support the ResultSet processing.cql
- The Query to Preparepsb
- The Binding implementationrse
- The implementation for extracting the results of the query.options
- The Query Options to apply to the PreparedStatementDataAccessException
void query(String cql, PreparedStatementBinder psb, RowCallbackHandler rch) throws DataAccessException
CachedPreparedStatementCreator
. Then, the PreparedStatementBinder will
bind its values to the bind variables in the provided CQL String. The results of the PreparedStatement are
processed with the RowCallbackHandler implementation provided and nothing is returned.cql
- The Query to Preparepsb
- The Binding implementationrch
- The RowCallbackHandler for processing the ResultSetDataAccessException
void query(String cql, PreparedStatementBinder psb, RowCallbackHandler rch, QueryOptions options) throws DataAccessException
CachedPreparedStatementCreator
. Then, the PreparedStatementBinder will
bind its values to the bind variables in the provided CQL String. The results of the PreparedStatement are
processed with the RowCallbackHandler implementation provided and nothing is returned.cql
- The Query to Preparepsb
- The Binding implementationrch
- The RowCallbackHandler for processing the ResultSetoptions
- The Query Options ObjectDataAccessException
<T> List<T> query(String cql, PreparedStatementBinder psb, RowMapper<T> rowMapper) throws DataAccessException
CachedPreparedStatementCreator
. Then, the PreparedStatementBinder will
bind its values to the bind variables in the provided CQL String. The results of the PreparedStatement are
processed with the RowMapper implementation provided and a List is returned with elements of Type cql
- The Query to Preparepsb
- The Binding implementationrowMapper
- The implementation for Mapping a Row to Type DataAccessException
<T> List<T> query(String cql, PreparedStatementBinder psb, RowMapper<T> rowMapper, QueryOptions options) throws DataAccessException
CachedPreparedStatementCreator
. Then, the PreparedStatementBinder will
bind its values to the bind variables in the provided CQL String. The results of the PreparedStatement are
processed with the RowMapper implementation provided and a List is returned with elements of Type cql
- The Query to Preparepsb
- The Binding implementationrowMapper
- The implementation for Mapping a Row to Type options
- The Query Options ObjectDataAccessException
<T> T query(PreparedStatementCreator psc, ResultSetExtractor<T> rse) throws DataAccessException
psc
- The implementation to create the PreparedStatementrse
- Implementation for extracting from the ResultSetDataAccessException
<T> T query(PreparedStatementCreator psc, ResultSetExtractor<T> rse, QueryOptions options) throws DataAccessException
psc
- The implementation to create the PreparedStatementrse
- Implementation for extracting from the ResultSetoptions
- The Query Options ObjectDataAccessException
void query(PreparedStatementCreator psc, RowCallbackHandler rch) throws DataAccessException
psc
- The implementation to create the PreparedStatementrch
- The implementation to process ResultsDataAccessException
void query(PreparedStatementCreator psc, RowCallbackHandler rch, QueryOptions options) throws DataAccessException
psc
- The implementation to create the PreparedStatementrch
- The implementation to process Resultsoptions
- The Query Options ObjectDataAccessException
<T> List<T> query(PreparedStatementCreator psc, RowMapper<T> rowMapper) throws DataAccessException
psc
- The implementation to create the PreparedStatementrowMapper
- The implementation for mapping each Row returned.DataAccessException
<T> List<T> query(PreparedStatementCreator psc, RowMapper<T> rowMapper, QueryOptions options) throws DataAccessException
psc
- The implementation to create the PreparedStatementrowMapper
- The implementation for mapping each Row returned.options
- The Query Options ObjectDataAccessException
<T> T query(PreparedStatementCreator psc, PreparedStatementBinder psb, ResultSetExtractor<T> rse, QueryOptions options) throws DataAccessException
psc
- The implementation to create the PreparedStatementpsb
- The implementation to bind variables to valuesrse
- Implementation for extracting from the ResultSetoptions
- The Query Options ObjectDataAccessException
<T> T query(PreparedStatementCreator psc, PreparedStatementBinder psb, ResultSetExtractor<T> rse) throws DataAccessException
psc
- The implementation to create the PreparedStatementpsb
- The implementation to bind variables to valuesrse
- Implementation for extracting from the ResultSetDataAccessException
void query(PreparedStatementCreator psc, PreparedStatementBinder psb, RowCallbackHandler rch, QueryOptions options) throws DataAccessException
psc
- The implementation to create the PreparedStatementpsb
- The implementation to bind variables to valuesrch
- The implementation to process Resultsoptions
- The Query Options ObjectDataAccessException
void query(PreparedStatementCreator psc, PreparedStatementBinder psb, RowCallbackHandler rch) throws DataAccessException
psc
- The implementation to create the PreparedStatementpsb
- The implementation to bind variables to valuesrch
- The implementation to process ResultsDataAccessException
<T> List<T> query(PreparedStatementCreator psc, PreparedStatementBinder psb, RowMapper<T> rowMapper, QueryOptions options) throws DataAccessException
psc
- The implementation to create the PreparedStatementpsb
- The implementation to bind variables to valuesrowMapper
- The implementation for mapping each Row returned.options
- The Query Options ObjectDataAccessException
<T> List<T> query(PreparedStatementCreator psc, PreparedStatementBinder psb, RowMapper<T> rowMapper) throws DataAccessException
psc
- The implementation to create the PreparedStatementpsb
- The implementation to bind variables to valuesrowMapper
- The implementation for mapping each Row returned.DataAccessException
List<RingMember> describeRing() throws DataAccessException
RingMemberHostMapper
to provide the basics of the
Cassandra Ring topology.DataAccessException
<T> Collection<T> describeRing(HostMapper<T> hostMapper) throws DataAccessException
HostMapper
implementation to process the
lists of hosts returned by the Cassandra Cluster Metadata.hostMapper
- The implementation to use for host mapping.DataAccessException
com.datastax.driver.core.Session getSession()
void ingest(String cql, RowIterator rowIterator, WriteOptions options)
This is used internally by the other ingest() methods, but can be used if you want to write your own RowIterator. The Object[] length returned by the next() implementation must match the number of bind variables in the CQL.
cql
- The CQLrowIterator
- Implementation to provide the Object[] to be bound to the CQL.options
- The Query Options Objectvoid ingest(String cql, RowIterator rowIterator)
This is used internally by the other ingest() methods, but can be used if you want to write your own RowIterator. The Object[] length returned by the next() implementation must match the number of bind variables in the CQL.
cql
- The CQLrowIterator
- Implementation to provide the Object[] to be bound to the CQL.void ingest(String cql, List<List<?>> rows, WriteOptions options)
The List> length must match the number of bind variables in the CQL.
cql
- The CQLrows
- List of List> with data to bind to the CQL.options
- The Query Options Objectvoid ingest(String cql, List<List<?>> rows)
PreparedStatement
once, then all row values are bound to that PreparedStatement
and executed against the Session
.
The lengths of the nested List
s must not be less than the number of bind variables in the CQL.
cql
- The CQLrows
- The data to bind to the CQL statementvoid ingest(String cql, Object[][] rows)
PreparedStatement
once, then all row values are bound to that PreparedStatement
and executed against the Session
.
The lengths of the nested object arrays must not be less than the number of bind variables in the CQL.
cql
- The CQLrows
- The data to bind to the CQL statementvoid ingest(String cql, Object[][] rows, WriteOptions options)
PreparedStatement
once, then all row values are bound to that PreparedStatement
and executed against the Session
.
The lengths of the nested object arrays must not be less than the number of bind variables in the CQL.
cql
- The CQLrows
- The data to bind to the CQL statementoptions
- The Query Options Objectvoid truncate(CqlIdentifier tableName)
tableName
- void truncate(String tableName)
tableName
- long count(CqlIdentifier tableName)
tableName
- long count(String tableName)
tableName
- com.datastax.driver.core.ResultSet execute(DropTableSpecification specification)
specification
- The specification to execute; must not be null.com.datastax.driver.core.ResultSet execute(CreateTableSpecification specification)
specification
- The specification to execute; must not be null.com.datastax.driver.core.ResultSet execute(AlterTableSpecification specification)
specification
- The specification to execute; must not be null.com.datastax.driver.core.ResultSet execute(DropKeyspaceSpecification specification)
specification
- The specification to execute; must not be null.com.datastax.driver.core.ResultSet execute(CreateKeyspaceSpecification specification)
specification
- The specification to execute; must not be null.com.datastax.driver.core.ResultSet execute(AlterKeyspaceSpecification specification)
specification
- The specification to execute; must not be null.com.datastax.driver.core.ResultSet execute(DropIndexSpecification specification)
specification
- The specification to execute; must not be null.com.datastax.driver.core.ResultSet execute(CreateIndexSpecification specification)
specification
- The specification to execute; must not be null.Copyright © 2011-2014–2015 Pivotal Software, Inc.. All rights reserved.