use of com.hazelcast.concurrent.lock.InternalLockNamespace in project hazelcast by hazelcast.
the class ConditionSignalAllMessageTask method prepareOperation.
@Override
protected Operation prepareOperation() {
final Data key = serializationService.toData(parameters.lockName);
final InternalLockNamespace namespace = new InternalLockNamespace(parameters.lockName);
return new SignalOperation(namespace, key, parameters.threadId, parameters.name, true);
}
use of com.hazelcast.concurrent.lock.InternalLockNamespace in project hazelcast by hazelcast.
the class PartitionControlledIdTest method testLock.
@Test
public void testLock() throws Exception {
String partitionKey = "hazelcast";
HazelcastInstance hz = getHazelcastInstance(partitionKey);
ILock lock = hz.getLock("lock@" + partitionKey);
lock.lock();
assertEquals("lock@" + partitionKey, lock.getName());
assertEquals(partitionKey, lock.getPartitionKey());
Node node = getNode(hz);
LockServiceImpl lockService = node.nodeEngine.getService(LockServiceImpl.SERVICE_NAME);
Partition partition = instances[0].getPartitionService().getPartition(partitionKey);
LockStore lockStore = lockService.getLockStore(partition.getPartitionId(), new InternalLockNamespace(lock.getName()));
Data key = node.getSerializationService().toData(lock.getName(), StringPartitioningStrategy.INSTANCE);
assertTrue(lockStore.isLocked(key));
}
Aggregations