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 |
---|---|
Future<Void> |
close()
Like
close(Handler) but returns a Future of the asynchronous result. |
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 |
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.
|
Future<ResultSet> |
execute(com.datastax.oss.driver.api.core.cql.Statement statement)
Like
execute(Statement, Handler) but returns a Future of the asynchronous result. |
<R> Future<R> |
execute(com.datastax.oss.driver.api.core.cql.Statement statement,
java.util.stream.Collector<com.datastax.oss.driver.api.core.cql.Row,?,R> collector)
Like
execute(Statement, Collector, Handler) but returns a Future of the asynchronous result. |
<R> CassandraClient |
execute(com.datastax.oss.driver.api.core.cql.Statement statement,
java.util.stream.Collector<com.datastax.oss.driver.api.core.cql.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.oss.driver.api.core.cql.Statement statement,
Handler<AsyncResult<ResultSet>> resultHandler)
Execute the statement and provide a handler for consuming results.
|
Future<ResultSet> |
execute(String query)
Like
execute(String, Handler) but returns a Future of the asynchronous result. |
<R> Future<R> |
execute(String query,
java.util.stream.Collector<com.datastax.oss.driver.api.core.cql.Row,?,R> collector)
Like
execute(String, Collector, Handler) but returns a Future of the asynchronous result. |
<R> CassandraClient |
execute(String query,
java.util.stream.Collector<com.datastax.oss.driver.api.core.cql.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.
|
Future<List<com.datastax.oss.driver.api.core.cql.Row>> |
executeWithFullFetch(com.datastax.oss.driver.api.core.cql.Statement statement)
Like
executeWithFullFetch(Statement, Handler) but returns a Future of the asynchronous result. |
CassandraClient |
executeWithFullFetch(com.datastax.oss.driver.api.core.cql.Statement statement,
Handler<AsyncResult<List<com.datastax.oss.driver.api.core.cql.Row>>> resultHandler)
Execute the query and provide a handler for consuming results.
|
Future<List<com.datastax.oss.driver.api.core.cql.Row>> |
executeWithFullFetch(String query)
Like
executeWithFullFetch(String, Handler) but returns a Future of the asynchronous result. |
CassandraClient |
executeWithFullFetch(String query,
Handler<AsyncResult<List<com.datastax.oss.driver.api.core.cql.Row>>> resultHandler)
Execute the query and provide a handler for consuming results.
|
boolean |
isConnected() |
Future<com.datastax.oss.driver.api.core.metadata.Metadata> |
metadata()
Like
metadata(Handler) but returns a Future of the asynchronous result. |
void |
metadata(Handler<AsyncResult<com.datastax.oss.driver.api.core.metadata.Metadata>> handler)
Get
Metadata for the session. |
Future<com.datastax.oss.driver.api.core.cql.PreparedStatement> |
prepare(com.datastax.oss.driver.api.core.cql.SimpleStatement statement)
Like
prepare(SimpleStatement, Handler) but returns a Future of the asynchronous result. |
CassandraClient |
prepare(com.datastax.oss.driver.api.core.cql.SimpleStatement statement,
Handler<AsyncResult<com.datastax.oss.driver.api.core.cql.PreparedStatement>> resultHandler)
Prepares the provided a
SimpleStatement . |
Future<com.datastax.oss.driver.api.core.cql.PreparedStatement> |
prepare(String query)
Like
prepare(String, Handler) but returns a Future of the asynchronous result. |
CassandraClient |
prepare(String query,
Handler<AsyncResult<com.datastax.oss.driver.api.core.cql.PreparedStatement>> resultHandler)
Prepares the provided query string.
|
Future<CassandraRowStream> |
queryStream(com.datastax.oss.driver.api.core.cql.Statement statement)
Like
queryStream(Statement, Handler) but returns a Future of the asynchronous result. |
CassandraClient |
queryStream(com.datastax.oss.driver.api.core.cql.Statement statement,
Handler<AsyncResult<CassandraRowStream>> rowStreamHandler)
Executes the given SQL statement which returns the results of the query as a read stream.
|
Future<CassandraRowStream> |
queryStream(String sql)
Like
queryStream(String, Handler) but returns a Future of the asynchronous result. |
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
static CassandraClient create(Vertx vertx)
create(Vertx, CassandraClientOptions)
with default options.static 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.oss.driver.api.core.cql.Row>>> resultHandler)
resultHandler
- handler called when result of execution is fully fetched.query
- the query to executeFuture<List<com.datastax.oss.driver.api.core.cql.Row>> executeWithFullFetch(String query)
executeWithFullFetch(String, Handler)
but returns a Future
of the asynchronous result.CassandraClient executeWithFullFetch(com.datastax.oss.driver.api.core.cql.Statement statement, Handler<AsyncResult<List<com.datastax.oss.driver.api.core.cql.Row>>> resultHandler)
resultHandler
- handler called when result of execution is fully fetched.statement
- the statement to executeFuture<List<com.datastax.oss.driver.api.core.cql.Row>> executeWithFullFetch(com.datastax.oss.driver.api.core.cql.Statement statement)
executeWithFullFetch(Statement, Handler)
but returns a Future
of the asynchronous result.CassandraClient 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 executeFuture<ResultSet> execute(String query)
execute(String, Handler)
but returns a Future
of the asynchronous result.<R> CassandraClient execute(String query, java.util.stream.Collector<com.datastax.oss.driver.api.core.cql.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 present<R> Future<R> execute(String query, java.util.stream.Collector<com.datastax.oss.driver.api.core.cql.Row,?,R> collector)
execute(String, Collector, Handler)
but returns a Future
of the asynchronous result.CassandraClient execute(com.datastax.oss.driver.api.core.cql.Statement statement, Handler<AsyncResult<ResultSet>> resultHandler)
resultHandler
- handler called when result of execution is presentstatement
- the statement to executeFuture<ResultSet> execute(com.datastax.oss.driver.api.core.cql.Statement statement)
execute(Statement, Handler)
but returns a Future
of the asynchronous result.<R> CassandraClient execute(com.datastax.oss.driver.api.core.cql.Statement statement, java.util.stream.Collector<com.datastax.oss.driver.api.core.cql.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 present<R> Future<R> execute(com.datastax.oss.driver.api.core.cql.Statement statement, java.util.stream.Collector<com.datastax.oss.driver.api.core.cql.Row,?,R> collector)
execute(Statement, Collector, Handler)
but returns a Future
of the asynchronous result.CassandraClient prepare(String query, Handler<AsyncResult<com.datastax.oss.driver.api.core.cql.PreparedStatement>> resultHandler)
resultHandler
- handler called when result of query preparation is presentquery
- the query to prepareFuture<com.datastax.oss.driver.api.core.cql.PreparedStatement> prepare(String query)
prepare(String, Handler)
but returns a Future
of the asynchronous result.CassandraClient prepare(com.datastax.oss.driver.api.core.cql.SimpleStatement statement, Handler<AsyncResult<com.datastax.oss.driver.api.core.cql.PreparedStatement>> resultHandler)
SimpleStatement
.resultHandler
- handler called when result of query preparation is presentstatement
- the statement to prepareFuture<com.datastax.oss.driver.api.core.cql.PreparedStatement> prepare(com.datastax.oss.driver.api.core.cql.SimpleStatement statement)
prepare(SimpleStatement, Handler)
but returns a Future
of the asynchronous result.CassandraClient 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
.Future<CassandraRowStream> queryStream(String sql)
queryStream(String, Handler)
but returns a Future
of the asynchronous result.CassandraClient queryStream(com.datastax.oss.driver.api.core.cql.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
.Future<CassandraRowStream> queryStream(com.datastax.oss.driver.api.core.cql.Statement statement)
queryStream(Statement, Handler)
but returns a Future
of the asynchronous result.Future<Void> close()
close(Handler)
but returns a Future
of the asynchronous result.CassandraClient close(Handler<AsyncResult<Void>> closeHandler)
closeHandler
- handler called when client is closedvoid metadata(Handler<AsyncResult<com.datastax.oss.driver.api.core.metadata.Metadata>> handler)
Metadata
for the session.handler
- the handler called backed with the metadataFuture<com.datastax.oss.driver.api.core.metadata.Metadata> metadata()
metadata(Handler)
but returns a Future
of the asynchronous result.Copyright © 2021 Eclipse. All rights reserved.