Class BaseAsyncQueryCall<K,V,Q extends Query>
- java.lang.Object
-
- io.streamthoughts.azkarra.api.query.DecorateQuery<Q>
-
- io.streamthoughts.azkarra.runtime.query.BaseAsyncQueryCall<K,V,Q>
-
- Direct Known Subclasses:
DistributedQueryCall
,EmptyQueryCall
,LocalQueryCall
public abstract class BaseAsyncQueryCall<K,V,Q extends Query> extends DecorateQuery<Q> implements QueryCall<K,V>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.streamthoughts.azkarra.api.query.QueryCall
QueryCall.QueryCallFactory
-
-
Field Summary
-
Fields inherited from class io.streamthoughts.azkarra.api.query.DecorateQuery
query
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
BaseAsyncQueryCall(Q query)
Creates a newBaseAsyncQueryCall
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancel()
Cancels theQueryCall
, if possible.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()
void
setIsExecuted(boolean isExecuted)
-
Methods inherited from class io.streamthoughts.azkarra.api.query.DecorateQuery
equals, getParams, getStoreName, getStoreOperation, getStoreType, hashCode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.streamthoughts.azkarra.api.query.Query
getParams, getStoreName, getStoreOperation, getStoreType
-
-
-
-
Constructor Detail
-
BaseAsyncQueryCall
protected BaseAsyncQueryCall(Q query)
Creates a newBaseAsyncQueryCall
instance.- Parameters:
query
- the query.
-
-
Method Detail
-
executeAsync
public CompletableFuture<QueryResult<K,V>> executeAsync(QueryOptions options)
Executes thisQueryCall
asynchronously.- Specified by:
executeAsync
in interfaceQueryCall<K,V>
- Parameters:
options
- the options to be used.- Returns:
- a
CompletableFuture
ofQueryResult
.
-
executeAsync
public void executeAsync(QueryOptions options, Consumer<QueryResult<K,V>> resultCallback)
Executes thisQueryCall
asynchronously.- Specified by:
executeAsync
in interfaceQueryCall<K,V>
- 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.
-
isExecuted
public boolean isExecuted()
- Specified by:
isExecuted
in interfaceQueryCall<K,V>
- Returns:
true
if thisQueryCall
has already been executed.
-
isCanceled
public boolean isCanceled()
- Specified by:
isCanceled
in interfaceQueryCall<K,V>
- Returns:
true
if thisQueryCall
has already been canceled.
-
setIsExecuted
public void setIsExecuted(boolean isExecuted)
-
-