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);
}
Aggregations