Interface CassandraClient
public interface CassandraClient
Eclipse Vert.x Cassandra client.
- Author:
- Pavel Drankou, Thomas Segismont
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionclose()Closes this client.static CassandraClientLikecreate(Vertx, CassandraClientOptions)with default options.static CassandraClientcreate(Vertx vertx, CassandraClientOptions options) Create a Cassandra client which maintains its own driver session.static CassandraClientcreateShared(Vertx vertx) LikecreateShared(Vertx, String, CassandraClientOptions)with default options and client name.static CassandraClientcreateShared(Vertx vertx, CassandraClientOptions options) LikecreateShared(Vertx, String, CassandraClientOptions)with default client name.static CassandraClientcreateShared(Vertx vertx, String clientName) LikecreateShared(Vertx, String, CassandraClientOptions)with default options.static CassandraClientcreateShared(Vertx vertx, String clientName, CassandraClientOptions options) Create a Cassandra client that shares its driver session with any other client having the same name.execute(com.datastax.oss.driver.api.core.cql.Statement statement) Execute the statement and provide a handler for consuming results.<R> Future<R> execute(com.datastax.oss.driver.api.core.cql.Statement statement, Collector<com.datastax.oss.driver.api.core.cql.Row, ?, R> collector) Execute a statement and produce a result by applying a collector to result set rows.Execute the query and provide a handler for consuming results.<R> Future<R> Execute a query and produce a result by applying a collector to result set rows.executeWithFullFetch(com.datastax.oss.driver.api.core.cql.Statement statement) Execute the query and provide a handler for consuming results.executeWithFullFetch(String query) Execute the query and provide a handler for consuming results.booleanFuture<com.datastax.oss.driver.api.core.metadata.Metadata> metadata()GetMetadatafor the session.Future<com.datastax.oss.driver.api.core.cql.PreparedStatement> prepare(com.datastax.oss.driver.api.core.cql.SimpleStatement statement) Prepares the provided aSimpleStatement.Future<com.datastax.oss.driver.api.core.cql.PreparedStatement> Prepares the provided query string.queryStream(com.datastax.oss.driver.api.core.cql.Statement statement) Executes the given SQL statement which returns the results of the query as a read stream.queryStream(String sql) Executes the given SQLSELECTstatement which returns the results of the query as a read stream.
-
Field Details
-
DEFAULT_SHARED_CLIENT_NAME
-
-
Method Details
-
create
Likecreate(Vertx, CassandraClientOptions)with default options. -
create
Create a Cassandra client which maintains its own driver session.It is not recommended to create several non shared clients in an application.
- Parameters:
vertx- the Vert.x instanceoptions- the options- Returns:
- the client
-
isConnected
boolean isConnected()- Returns:
- whether this Cassandra client instance is connected
-
executeWithFullFetch
-
executeWithFullFetch
-
execute
-
execute
<R> Future<R> execute(String query, Collector<com.datastax.oss.driver.api.core.cql.Row, ?, R> collector) Execute a query and produce a result by applying a collector to result set rows.- Type Parameters:
R- the result type- Parameters:
query- the query to executecollector- the collector to use to produce a result- Returns:
- a future of the result
-
execute
-
execute
<R> Future<R> execute(com.datastax.oss.driver.api.core.cql.Statement statement, Collector<com.datastax.oss.driver.api.core.cql.Row, ?, R> collector) Execute a statement and produce a result by applying a collector to result set rows.- Type Parameters:
R- the result type- Parameters:
statement- the statement to executecollector- the collector to use to produce a result- Returns:
- a future of the result
-
prepare
-
prepare
Future<com.datastax.oss.driver.api.core.cql.PreparedStatement> prepare(com.datastax.oss.driver.api.core.cql.SimpleStatement statement) Prepares the provided aSimpleStatement.- Parameters:
statement- the statement to prepare- Returns:
- a future of the result
-
queryStream
Executes the given SQLSELECTstatement which returns the results of the query as a read stream.- Parameters:
sql- the SQL to execute. For exampleSELECT * FROM table ....- Returns:
- a future of the result
-
queryStream
Executes the given SQL statement which returns the results of the query as a read stream.- Parameters:
statement- the statement to execute.- Returns:
- a future of the result
-
close
-
metadata
Future<com.datastax.oss.driver.api.core.metadata.Metadata> metadata()GetMetadatafor the session.- Returns:
- a future of the result
-