Search in sources :

Example 1 with CacheGetAndReplaceCodec

use of com.hazelcast.client.impl.protocol.codec.CacheGetAndReplaceCodec in project hazelcast by hazelcast.

the class ClientCacheProxySupport method doGetAndReplaceOnServer.

private <T> CompletableFuture<T> doGetAndReplaceOnServer(Data keyData, Data newValueData, Data expiryPolicyData, boolean withCompletionEvent, BiConsumer<T, Throwable> statsCallback) {
    int completionId = withCompletionEvent ? nextCompletionId() : -1;
    ClientMessage request = CacheGetAndReplaceCodec.encodeRequest(nameWithPrefix, keyData, newValueData, expiryPolicyData, completionId);
    ClientInvocationFuture future = invoke(request, keyData, completionId);
    ClientDelegatingFuture<T> delegatingFuture = newDelegatingFuture(future, CacheGetAndReplaceCodec::decodeResponse);
    return addCallback(delegatingFuture, statsCallback);
}
Also used : CacheGetAndReplaceCodec(com.hazelcast.client.impl.protocol.codec.CacheGetAndReplaceCodec) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage) ClientInvocationFuture(com.hazelcast.client.impl.spi.impl.ClientInvocationFuture)

Aggregations

ClientMessage (com.hazelcast.client.impl.protocol.ClientMessage)1 CacheGetAndReplaceCodec (com.hazelcast.client.impl.protocol.codec.CacheGetAndReplaceCodec)1 ClientInvocationFuture (com.hazelcast.client.impl.spi.impl.ClientInvocationFuture)1