Search in sources :

Example 1 with InitOperation

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

the class SemaphoreProxy method init.

@Override
public boolean init(int permits) {
    checkNotNegative(permits, "permits can't be negative");
    Operation operation = new InitOperation(name, permits).setPartitionId(partitionId);
    InternalCompletableFuture<Boolean> future = invokeOnPartition(operation);
    return future.join();
}
Also used : InitOperation(com.hazelcast.concurrent.semaphore.operations.InitOperation) Operation(com.hazelcast.spi.Operation) AvailableOperation(com.hazelcast.concurrent.semaphore.operations.AvailableOperation) ReduceOperation(com.hazelcast.concurrent.semaphore.operations.ReduceOperation) AcquireOperation(com.hazelcast.concurrent.semaphore.operations.AcquireOperation) DrainOperation(com.hazelcast.concurrent.semaphore.operations.DrainOperation) ReleaseOperation(com.hazelcast.concurrent.semaphore.operations.ReleaseOperation) InitOperation(com.hazelcast.concurrent.semaphore.operations.InitOperation)

Aggregations

AcquireOperation (com.hazelcast.concurrent.semaphore.operations.AcquireOperation)1 AvailableOperation (com.hazelcast.concurrent.semaphore.operations.AvailableOperation)1 DrainOperation (com.hazelcast.concurrent.semaphore.operations.DrainOperation)1 InitOperation (com.hazelcast.concurrent.semaphore.operations.InitOperation)1 ReduceOperation (com.hazelcast.concurrent.semaphore.operations.ReduceOperation)1 ReleaseOperation (com.hazelcast.concurrent.semaphore.operations.ReleaseOperation)1 Operation (com.hazelcast.spi.Operation)1