Package io.confluent.ksql.api.client
Interface Client
-
public interface Client
A client that connects to a specific ksqlDB server.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
Closes the underlying HTTP client.static Client
create(ClientOptions clientOptions)
static Client
create(ClientOptions clientOptions, io.vertx.core.Vertx vertx)
BatchedQueryResult
executeQuery(String sql)
Executes a query (push or pull) and returns all result rows in a single batch, once the query has completed.BatchedQueryResult
executeQuery(String sql, Map<String,Object> properties)
Executes a query (push or pull) and returns all result rows in a single batch, once the query has completed.CompletableFuture<Void>
insertInto(String streamName, KsqlObject row)
Inserts a row into a ksqlDB stream.CompletableFuture<StreamedQueryResult>
streamQuery(String sql)
Executes a query (push or pull) and returns the results one row at a time.CompletableFuture<StreamedQueryResult>
streamQuery(String sql, Map<String,Object> properties)
Executes a query (push or pull) and returns the results one row at a time.CompletableFuture<Void>
terminatePushQuery(String queryId)
Terminates a push query with the specified query ID.
-
-
-
Method Detail
-
streamQuery
CompletableFuture<StreamedQueryResult> streamQuery(String sql)
Executes a query (push or pull) and returns the results one row at a time.If a non-200 response is received from the server, the
CompletableFuture
will be failed.- Parameters:
sql
- statement of query to execute- Returns:
- a future that completes once the server response is received, and contains the query result if successful
-
streamQuery
CompletableFuture<StreamedQueryResult> streamQuery(String sql, Map<String,Object> properties)
Executes a query (push or pull) and returns the results one row at a time.If a non-200 response is received from the server, the
CompletableFuture
will be failed.- Parameters:
sql
- statement of query to executeproperties
- query properties- Returns:
- a future that completes once the server response is received, and contains the query result if successful
-
executeQuery
BatchedQueryResult executeQuery(String sql)
Executes a query (push or pull) and returns all result rows in a single batch, once the query has completed.- Parameters:
sql
- statement of query to execute- Returns:
- query result
-
executeQuery
BatchedQueryResult executeQuery(String sql, Map<String,Object> properties)
Executes a query (push or pull) and returns all result rows in a single batch, once the query has completed.- Parameters:
sql
- statement of query to executeproperties
- query properties- Returns:
- query result
-
insertInto
CompletableFuture<Void> insertInto(String streamName, KsqlObject row)
Inserts a row into a ksqlDB stream.The
CompletableFuture
will be failed if a non-200 response is received from the server, or if the server encounters an error while processing the insertion.- Parameters:
streamName
- name of the target streamrow
- the row to insert. Keys are column names and values are column values.- Returns:
- a future that completes once the server response is received
-
terminatePushQuery
CompletableFuture<Void> terminatePushQuery(String queryId)
Terminates a push query with the specified query ID.If a non-200 response is received from the server, the
CompletableFuture
will be failed.- Parameters:
queryId
- ID of the query to terminate- Returns:
- a future that completes once the server response is received
-
close
void close()
Closes the underlying HTTP client.
-
create
static Client create(ClientOptions clientOptions)
-
create
static Client create(ClientOptions clientOptions, io.vertx.core.Vertx vertx)
-
-