Search in sources :

Example 1 with LocalGetOp

use of com.hazelcast.cp.internal.datastructures.atomiclong.operation.LocalGetOp in project hazelcast by hazelcast.

the class AtomicLongProxy method localGetAsync.

public InternalCompletableFuture<Long> localGetAsync(QueryPolicy queryPolicy) {
    InternalCompletableFuture<Long> resultFuture = new InternalCompletableFuture<>();
    InternalCompletableFuture<Long> localFuture = invocationManager.queryLocally(groupId, new LocalGetOp(objectName), queryPolicy);
    localFuture.whenCompleteAsync((response, throwable) -> {
        if (throwable == null) {
            resultFuture.complete(response);
        } else {
            InternalCompletableFuture<Long> future = invocationManager.query(groupId, new LocalGetOp(objectName), queryPolicy);
            future.whenCompleteAsync(completingCallback(resultFuture));
        }
    });
    return resultFuture;
}
Also used : LocalGetOp(com.hazelcast.cp.internal.datastructures.atomiclong.operation.LocalGetOp) InternalCompletableFuture(com.hazelcast.spi.impl.InternalCompletableFuture) IAtomicLong(com.hazelcast.cp.IAtomicLong)

Aggregations

IAtomicLong (com.hazelcast.cp.IAtomicLong)1 LocalGetOp (com.hazelcast.cp.internal.datastructures.atomiclong.operation.LocalGetOp)1 InternalCompletableFuture (com.hazelcast.spi.impl.InternalCompletableFuture)1