use of com.hazelcast.client.impl.ClientDelegatingFuture 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.ClientDelegatingFuture in project hazelcast by hazelcast.
the class HazelcastCommandLine method getClusterMetadata.
protected static CompletableFuture<MCClusterMetadata> getClusterMetadata(HazelcastClientInstanceImpl client, Member member) {
checkNotNull(member);
ClientInvocation invocation = new ClientInvocation(client, MCGetClusterMetadataCodec.encodeRequest(), null, member.getUuid());
return new ClientDelegatingFuture<>(invocation.invoke(), client.getSerializationService(), clientMessage -> {
MCGetClusterMetadataCodec.ResponseParameters response = MCGetClusterMetadataCodec.decodeResponse(clientMessage);
MCClusterMetadata metadata = new MCClusterMetadata();
metadata.setCurrentState(ClusterState.getById(response.currentState));
metadata.setClusterTime(response.clusterTime);
metadata.setMemberVersion(response.memberVersion);
return metadata;
});
}
use of com.hazelcast.client.impl.ClientDelegatingFuture 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.ClientDelegatingFuture 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.ClientDelegatingFuture 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