use of com.hazelcast.client.impl.spi.impl.ClientInvocationFuture in project hazelcast by hazelcast.
the class ClientRingbufferProxy method addAsync.
@Override
public InternalCompletableFuture<Long> addAsync(@Nonnull E item, @Nonnull OverflowPolicy overflowPolicy) {
checkNotNull(item, "item can't be null");
checkNotNull(overflowPolicy, "overflowPolicy can't be null");
Data element = toData(item);
ClientMessage request = RingbufferAddCodec.encodeRequest(name, overflowPolicy.getId(), element);
try {
ClientInvocationFuture future = new ClientInvocation(getClient(), request, getName(), partitionId).invoke();
return new ClientDelegatingFuture<>(future, getSerializationService(), RingbufferAddCodec::decodeResponse);
} catch (Exception e) {
throw rethrow(e);
}
}
use of com.hazelcast.client.impl.spi.impl.ClientInvocationFuture in project hazelcast by hazelcast.
the class ClientProxySessionManager method heartbeat.
@Override
protected InternalCompletableFuture<Object> heartbeat(RaftGroupId groupId, long sessionId) {
ClientMessage request = CPSessionHeartbeatSessionCodec.encodeRequest(groupId, sessionId);
ClientInvocationFuture future = new ClientInvocation(client, request, "sessionManager").invoke();
return new ClientDelegatingFuture<>(future, client.getSerializationService(), clientMessage -> null);
}
use of com.hazelcast.client.impl.spi.impl.ClientInvocationFuture in project hazelcast by hazelcast.
the class AtomicLongProxy method getAndAddAsync.
@Override
public InternalCompletableFuture<Long> getAndAddAsync(long delta) {
ClientMessage request = AtomicLongGetAndAddCodec.encodeRequest(groupId, objectName, delta);
ClientInvocationFuture future = new ClientInvocation(getClient(), request, name).invoke();
return new ClientDelegatingFuture<>(future, getSerializationService(), AtomicLongGetAndAddCodec::decodeResponse);
}
use of com.hazelcast.client.impl.spi.impl.ClientInvocationFuture in project hazelcast by hazelcast.
the class AtomicLongProxy method getAndSetAsync.
@Override
public InternalCompletableFuture<Long> getAndSetAsync(long newValue) {
ClientMessage request = AtomicLongGetAndSetCodec.encodeRequest(groupId, objectName, newValue);
ClientInvocationFuture future = new ClientInvocation(getClient(), request, name).invoke();
return new ClientDelegatingFuture<>(future, getSerializationService(), AtomicLongGetAndSetCodec::decodeResponse);
}
use of com.hazelcast.client.impl.spi.impl.ClientInvocationFuture in project hazelcast by hazelcast.
the class AtomicLongProxy method compareAndSetAsync.
@Override
public InternalCompletableFuture<Boolean> compareAndSetAsync(long expect, long update) {
ClientMessage request = AtomicLongCompareAndSetCodec.encodeRequest(groupId, objectName, expect, update);
ClientInvocationFuture future = new ClientInvocation(getClient(), request, name).invoke();
return new ClientDelegatingFuture<>(future, getSerializationService(), AtomicLongCompareAndSetCodec::decodeResponse);
}
Aggregations