public interface CassandraClient
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_SHARED_CLIENT_NAME
The default shared client name.
|
Modifier and Type | Method and Description |
---|---|
CassandraClient |
close()
Closes this client.
|
CassandraClient |
close(Handler<AsyncResult<Void>> closeHandler)
Closes this client.
|
static CassandraClient |
create(Vertx vertx)
Like
create(Vertx, CassandraClientOptions) with default options. |
static CassandraClient |
create(Vertx vertx,
CassandraClientOptions options)
Create a Cassandra client which maintains its own driver session.
|
static CassandraClient |
createNonShared(Vertx vertx)
Deprecated.
use
create(Vertx) instead |
static CassandraClient |
createNonShared(Vertx vertx,
CassandraClientOptions options)
Deprecated.
use
create(Vertx, CassandraClientOptions) instead |
static CassandraClient |
createShared(Vertx vertx)
Like
createShared(Vertx, String, CassandraClientOptions) with default options and client name. |
static CassandraClient |
createShared(Vertx vertx,
CassandraClientOptions options)
Like
createShared(Vertx, String, CassandraClientOptions) with default client name. |
static CassandraClient |
createShared(Vertx vertx,
String clientName)
Like
createShared(Vertx, String, CassandraClientOptions) with default options. |
static CassandraClient |
createShared(Vertx vertx,
String clientName,
CassandraClientOptions options)
Create a Cassandra client that shares its driver session with any other client having the same name.
|
<R> CassandraClient |
execute(com.datastax.driver.core.Statement statement,
java.util.stream.Collector<com.datastax.driver.core.Row,?,R> collector,
Handler<AsyncResult<R>> resultHandler)
Execute a statement and produce a result by applying a collector to result set rows.
|
CassandraClient |
execute(com.datastax.driver.core.Statement statement,
Handler<AsyncResult<ResultSet>> resultHandler)
Execute the statement and provide a handler for consuming results.
|
<R> CassandraClient |
execute(String query,
java.util.stream.Collector<com.datastax.driver.core.Row,?,R> collector,
Handler<AsyncResult<R>> resultHandler)
Execute a query and produce a result by applying a collector to result set rows.
|
CassandraClient |
execute(String query,
Handler<AsyncResult<ResultSet>> resultHandler)
Execute the query and provide a handler for consuming results.
|
CassandraClient |
executeWithFullFetch(com.datastax.driver.core.Statement statement,
Handler<AsyncResult<List<com.datastax.driver.core.Row>>> resultHandler)
Execute the query and provide a handler for consuming results.
|
CassandraClient |
executeWithFullFetch(String query,
Handler<AsyncResult<List<com.datastax.driver.core.Row>>> resultHandler)
Execute the query and provide a handler for consuming results.
|
boolean |
isConnected() |
CassandraClient |
prepare(String query,
Handler<AsyncResult<com.datastax.driver.core.PreparedStatement>> resultHandler)
Prepares the provided query string.
|
CassandraClient |
queryStream(com.datastax.driver.core.Statement statement,
Handler<AsyncResult<CassandraRowStream>> rowStreamHandler)
Executes the given SQL statement which returns the results of the query as a read stream.
|
CassandraClient |
queryStream(String sql,
Handler<AsyncResult<CassandraRowStream>> rowStreamHandler)
Executes the given SQL
SELECT statement which returns the results of the query as a read stream. |
static final String DEFAULT_SHARED_CLIENT_NAME
@Deprecated static CassandraClient createNonShared(Vertx vertx)
create(Vertx)
insteadstatic CassandraClient create(Vertx vertx)
create(Vertx, CassandraClientOptions)
with default options.@Deprecated static CassandraClient createNonShared(Vertx vertx, CassandraClientOptions options)
create(Vertx, CassandraClientOptions)
insteadstatic CassandraClient create(Vertx vertx, CassandraClientOptions options)
It is not recommended to create several non shared clients in an application.
vertx
- the Vert.x instanceoptions
- the optionsstatic CassandraClient createShared(Vertx vertx)
createShared(Vertx, String, CassandraClientOptions)
with default options and client name.static CassandraClient createShared(Vertx vertx, String clientName)
createShared(Vertx, String, CassandraClientOptions)
with default options.static CassandraClient createShared(Vertx vertx, CassandraClientOptions options)
createShared(Vertx, String, CassandraClientOptions)
with default client name.static CassandraClient createShared(Vertx vertx, String clientName, CassandraClientOptions options)
vertx
- the Vert.x instanceoptions
- the optionsclientName
- the shared client nameboolean isConnected()
CassandraClient executeWithFullFetch(String query, Handler<AsyncResult<List<com.datastax.driver.core.Row>>> resultHandler)
resultHandler
- handler called when result of execution is fully fetched.query
- the query to executeCassandraClient executeWithFullFetch(com.datastax.driver.core.Statement statement, Handler<AsyncResult<List<com.datastax.driver.core.Row>>> resultHandler)
resultHandler
- handler called when result of execution is fully fetched.statement
- the statement to executeCassandraClient execute(String query, Handler<AsyncResult<ResultSet>> resultHandler)
resultHandler
- handler called when result of execution is present, but can be not fully fetchedquery
- the query to execute<R> CassandraClient execute(String query, java.util.stream.Collector<com.datastax.driver.core.Row,?,R> collector, Handler<AsyncResult<R>> resultHandler)
R
- the result typequery
- the query to executecollector
- the collector to use to produce a resultresultHandler
- the handler called when result of execution and collection is presentCassandraClient execute(com.datastax.driver.core.Statement statement, Handler<AsyncResult<ResultSet>> resultHandler)
resultHandler
- handler called when result of execution is presentstatement
- the statement to execute<R> CassandraClient execute(com.datastax.driver.core.Statement statement, java.util.stream.Collector<com.datastax.driver.core.Row,?,R> collector, Handler<AsyncResult<R>> resultHandler)
R
- the result typestatement
- the statement to executecollector
- the collector to use to produce a resultresultHandler
- the handler called when result of execution and collection is presentCassandraClient prepare(String query, Handler<AsyncResult<com.datastax.driver.core.PreparedStatement>> resultHandler)
resultHandler
- handler called when result of query preparation is presentquery
- the query to prepareCassandraClient queryStream(String sql, Handler<AsyncResult<CassandraRowStream>> rowStreamHandler)
SELECT
statement which returns the results of the query as a read stream.sql
- the SQL to execute. For example SELECT * FROM table ...
.rowStreamHandler
- the handler which is called once the operation completes. It will return an instance of CassandraRowStream
.CassandraClient queryStream(com.datastax.driver.core.Statement statement, Handler<AsyncResult<CassandraRowStream>> rowStreamHandler)
statement
- the statement to execute.rowStreamHandler
- the handler which is called once the operation completes. It will return an instance of CassandraRowStream
.CassandraClient close()
CassandraClient close(Handler<AsyncResult<Void>> closeHandler)
closeHandler
- handler called when client is closedCopyright © 2023 Eclipse. All rights reserved.