Interface QueryCall<K,V>
-
- Type Parameters:
K
- type of the record-key.V
- type of the record-value.
- All Superinterfaces:
Query
- All Known Implementing Classes:
BaseAsyncQueryCall
,DistributedQueryCall
,EmptyQueryCall
,LocalQueryCall
,RestApiQueryCall
public interface QueryCall<K,V> extends Query
AQueryCall
is a query that has been prepared for execution.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
QueryCall.QueryCallFactory
AQueryCallFactory
is used to create newQueryCall
.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
cancel()
Cancels theQueryCall
, if possible.QueryResult<K,V>
execute(QueryOptions options)
Executes thisQueryCall
.CompletableFuture<QueryResult<K,V>>
executeAsync(QueryOptions options)
Executes thisQueryCall
asynchronously.void
executeAsync(QueryOptions options, Consumer<QueryResult<K,V>> resultCallback)
Executes thisQueryCall
asynchronously.boolean
isCanceled()
boolean
isExecuted()
QueryCall<K,V>
renew()
Create a new, identicalQueryCall
to this one which can be re-executed even if this call has already been.-
Methods inherited from interface io.streamthoughts.azkarra.api.query.Query
getParams, getStoreName, getStoreOperation, getStoreType
-
-
-
-
Method Detail
-
execute
QueryResult<K,V> execute(QueryOptions options)
Executes thisQueryCall
.- Parameters:
options
- the options to be used.- Returns:
- the
QueryResult
. - Throws:
IllegalStateException
- when theQueryCall
has already been executed.
-
executeAsync
CompletableFuture<QueryResult<K,V>> executeAsync(QueryOptions options)
Executes thisQueryCall
asynchronously.- Parameters:
options
- the options to be used.- Returns:
- a
CompletableFuture
ofQueryResult
. - Throws:
IllegalStateException
- when theQueryCall
has already been executed.
-
executeAsync
void executeAsync(QueryOptions options, Consumer<QueryResult<K,V>> resultCallback)
Executes thisQueryCall
asynchronously.- Parameters:
options
- the options to be used.resultCallback
- the callback to be invoked when thisQueryCall
complete with either a success result or a failure exception.- Throws:
IllegalStateException
- when theQueryCall
has already been executed.
-
cancel
void cancel()
-
isExecuted
boolean isExecuted()
- Returns:
true
if thisQueryCall
has already been executed.
-
isCanceled
boolean isCanceled()
- Returns:
true
if thisQueryCall
has already been canceled.
-
-