Search in sources :

Example 1 with SemaphoreDetachMemberOperation

use of com.hazelcast.concurrent.semaphore.operations.SemaphoreDetachMemberOperation in project hazelcast by hazelcast.

the class SemaphoreService method onOwnerDisconnected.

private void onOwnerDisconnected(final String owner) {
    OperationService operationService = nodeEngine.getOperationService();
    for (Map.Entry<String, SemaphoreContainer> entry : containers.entrySet()) {
        String name = entry.getKey();
        SemaphoreContainer container = entry.getValue();
        Operation op = new SemaphoreDetachMemberOperation(name, owner).setPartitionId(container.getPartitionId()).setValidateTarget(false).setService(this).setNodeEngine(nodeEngine).setServiceName(SERVICE_NAME);
        // op will be executed on partition thread locally.
        // Invocation is to handle retries (if partition is being migrated).
        operationService.invokeOnTarget(SERVICE_NAME, op, nodeEngine.getThisAddress());
    }
}
Also used : SemaphoreDetachMemberOperation(com.hazelcast.concurrent.semaphore.operations.SemaphoreDetachMemberOperation) OperationService(com.hazelcast.spi.OperationService) SemaphoreReplicationOperation(com.hazelcast.concurrent.semaphore.operations.SemaphoreReplicationOperation) Operation(com.hazelcast.spi.Operation) SemaphoreDetachMemberOperation(com.hazelcast.concurrent.semaphore.operations.SemaphoreDetachMemberOperation) HashMap(java.util.HashMap) ConcurrentMap(java.util.concurrent.ConcurrentMap) Map(java.util.Map) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap)

Aggregations

SemaphoreDetachMemberOperation (com.hazelcast.concurrent.semaphore.operations.SemaphoreDetachMemberOperation)1 SemaphoreReplicationOperation (com.hazelcast.concurrent.semaphore.operations.SemaphoreReplicationOperation)1 Operation (com.hazelcast.spi.Operation)1 OperationService (com.hazelcast.spi.OperationService)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 ConcurrentMap (java.util.concurrent.ConcurrentMap)1