Search in sources :

Example 1 with ReduceOperation

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

the class SemaphoreProxy method reducePermits.

@Override
public void reducePermits(int reduction) {
    checkNotNegative(reduction, "reduction can't be negative");
    Operation operation = new ReduceOperation(name, reduction).setPartitionId(partitionId);
    InternalCompletableFuture<Object> future = invokeOnPartition(operation);
    future.join();
}
Also used : AbstractDistributedObject(com.hazelcast.spi.AbstractDistributedObject) 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) ReduceOperation(com.hazelcast.concurrent.semaphore.operations.ReduceOperation)

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 AbstractDistributedObject (com.hazelcast.spi.AbstractDistributedObject)1 Operation (com.hazelcast.spi.Operation)1