use of com.hazelcast.cp.internal.datastructures.lock.AcquireResult in project hazelcast by hazelcast.
the class TryLockOp method run.
@Override
public Object run(CPGroupId groupId, long commitIndex) {
LockService service = getService();
LockInvocationKey key = new LockInvocationKey(commitIndex, invocationUid, callerAddress, callId, getLockEndpoint());
AcquireResult result = service.acquire(groupId, name, key, timeoutMs);
if (result.status() == WAIT_KEY_ADDED) {
return PostponedResponse.INSTANCE;
}
// SUCCESSFUL or FAILED
return result.fence();
}
use of com.hazelcast.cp.internal.datastructures.lock.AcquireResult in project hazelcast by hazelcast.
the class LockOp method run.
@Override
public Object run(CPGroupId groupId, long commitIndex) {
LockService service = getService();
LockInvocationKey key = new LockInvocationKey(commitIndex, invocationUid, callerAddress, callId, getLockEndpoint());
AcquireResult result = service.acquire(groupId, name, key, -1L);
if (result.status() == WAIT_KEY_ADDED) {
return PostponedResponse.INSTANCE;
}
// SUCCESSFUL or FAILED
return result.fence();
}
Aggregations