Search in sources :

Example 1 with LockStoreImpl

use of com.hazelcast.concurrent.lock.LockStoreImpl in project hazelcast by hazelcast.

the class UnlockOperation method afterRun.

@Override
public void afterRun() throws Exception {
    LockStoreImpl lockStore = getLockStore();
    AwaitOperation awaitOperation = lockStore.pollExpiredAwaitOp(key);
    if (awaitOperation != null) {
        awaitOperation.runExpired();
    }
    shouldNotify = awaitOperation == null;
}
Also used : LockStoreImpl(com.hazelcast.concurrent.lock.LockStoreImpl)

Example 2 with LockStoreImpl

use of com.hazelcast.concurrent.lock.LockStoreImpl in project hazelcast by hazelcast.

the class LocalLockCleanupOperation method run.

@Override
public void run() throws Exception {
    LockStoreImpl lockStore = getLockStore();
    LockResource lock = lockStore.getLock(key);
    if (uuid.equals(lock.getOwner())) {
        ILogger logger = getLogger();
        if (logger.isFinestEnabled()) {
            logger.finest("Unlocking lock owned by uuid: " + uuid + ", thread-id: " + lock.getThreadId() + ", count: " + lock.getLockCount());
        }
        response = lockStore.forceUnlock(key);
    }
}
Also used : LockStoreImpl(com.hazelcast.concurrent.lock.LockStoreImpl) LockResource(com.hazelcast.concurrent.lock.LockResource) ILogger(com.hazelcast.logging.ILogger)

Example 3 with LockStoreImpl

use of com.hazelcast.concurrent.lock.LockStoreImpl in project hazelcast by hazelcast.

the class LockReplicationOperation method readInternal.

@Override
protected void readInternal(final ObjectDataInput in) throws IOException {
    super.readInternal(in);
    int len = in.readInt();
    if (len > 0) {
        for (int i = 0; i < len; i++) {
            LockStoreImpl ls = new LockStoreImpl();
            ls.readData(in);
            locks.add(ls);
        }
    }
}
Also used : LockStoreImpl(com.hazelcast.concurrent.lock.LockStoreImpl)

Example 4 with LockStoreImpl

use of com.hazelcast.concurrent.lock.LockStoreImpl in project hazelcast by hazelcast.

the class LockReplicationOperation method run.

@Override
public void run() {
    LockServiceImpl lockService = getService();
    LockStoreContainer container = lockService.getLockContainer(getPartitionId());
    for (LockStoreImpl ls : locks) {
        container.put(ls);
    }
}
Also used : LockStoreImpl(com.hazelcast.concurrent.lock.LockStoreImpl) LockServiceImpl(com.hazelcast.concurrent.lock.LockServiceImpl) LockStoreContainer(com.hazelcast.concurrent.lock.LockStoreContainer)

Example 5 with LockStoreImpl

use of com.hazelcast.concurrent.lock.LockStoreImpl in project hazelcast by hazelcast.

the class UnlockBackupOperation method run.

@Override
public void run() throws Exception {
    LockStoreImpl lockStore = getLockStore();
    boolean unlocked;
    if (force) {
        unlocked = lockStore.forceUnlock(key);
    } else {
        unlocked = lockStore.unlock(key, originalCallerUuid, threadId, getReferenceCallId());
    }
    response = unlocked;
    lockStore.pollExpiredAwaitOp(key);
}
Also used : LockStoreImpl(com.hazelcast.concurrent.lock.LockStoreImpl)

Aggregations

LockStoreImpl (com.hazelcast.concurrent.lock.LockStoreImpl)23 LockServiceImpl (com.hazelcast.concurrent.lock.LockServiceImpl)2 LockStoreContainer (com.hazelcast.concurrent.lock.LockStoreContainer)2 ILogger (com.hazelcast.logging.ILogger)2 ConditionKey (com.hazelcast.concurrent.lock.ConditionKey)1 LockResource (com.hazelcast.concurrent.lock.LockResource)1 HazelcastInstance (com.hazelcast.core.HazelcastInstance)1 MultiMap (com.hazelcast.core.MultiMap)1 NodeEngineImpl (com.hazelcast.spi.impl.NodeEngineImpl)1 ParallelTest (com.hazelcast.test.annotation.ParallelTest)1 QuickTest (com.hazelcast.test.annotation.QuickTest)1 Test (org.junit.Test)1