Search in sources :

Example 1 with AtomicLongAlterCodec

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

the class AtomicLongProxy method getAndAlterAsync.

@Override
public InternalCompletableFuture<Long> getAndAlterAsync(IFunction<Long, Long> function) {
    Data f = getSerializationService().toData(function);
    ClientMessage request = AtomicLongAlterCodec.encodeRequest(groupId, objectName, f, OLD_VALUE.value());
    ClientInvocationFuture future = new ClientInvocation(getClient(), request, name).invoke();
    return new ClientDelegatingFuture<>(future, getSerializationService(), AtomicLongAlterCodec::decodeResponse);
}
Also used : ClientDelegatingFuture(com.hazelcast.client.impl.ClientDelegatingFuture) Data(com.hazelcast.internal.serialization.Data) ClientInvocation(com.hazelcast.client.impl.spi.impl.ClientInvocation) AtomicLongAlterCodec(com.hazelcast.client.impl.protocol.codec.AtomicLongAlterCodec) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage) ClientInvocationFuture(com.hazelcast.client.impl.spi.impl.ClientInvocationFuture)

Example 2 with AtomicLongAlterCodec

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

the class AtomicLongProxy method alterAndGetAsync.

@Override
public InternalCompletableFuture<Long> alterAndGetAsync(IFunction<Long, Long> function) {
    Data f = getSerializationService().toData(function);
    ClientMessage request = AtomicLongAlterCodec.encodeRequest(groupId, objectName, f, NEW_VALUE.value());
    ClientInvocationFuture future = new ClientInvocation(getClient(), request, name).invoke();
    return new ClientDelegatingFuture<>(future, getSerializationService(), AtomicLongAlterCodec::decodeResponse);
}
Also used : ClientDelegatingFuture(com.hazelcast.client.impl.ClientDelegatingFuture) Data(com.hazelcast.internal.serialization.Data) ClientInvocation(com.hazelcast.client.impl.spi.impl.ClientInvocation) AtomicLongAlterCodec(com.hazelcast.client.impl.protocol.codec.AtomicLongAlterCodec) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage) ClientInvocationFuture(com.hazelcast.client.impl.spi.impl.ClientInvocationFuture)

Aggregations

ClientDelegatingFuture (com.hazelcast.client.impl.ClientDelegatingFuture)2 ClientMessage (com.hazelcast.client.impl.protocol.ClientMessage)2 AtomicLongAlterCodec (com.hazelcast.client.impl.protocol.codec.AtomicLongAlterCodec)2 ClientInvocation (com.hazelcast.client.impl.spi.impl.ClientInvocation)2 ClientInvocationFuture (com.hazelcast.client.impl.spi.impl.ClientInvocationFuture)2 Data (com.hazelcast.internal.serialization.Data)2