Search in sources :

Example 1 with DrainOperation

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

the class SemaphoreProxy method drainPermits.

@Override
public int drainPermits() {
    Operation operation = new DrainOperation(name).setPartitionId(partitionId);
    InternalCompletableFuture<Integer> future = invokeOnPartition(operation);
    return future.join();
}
Also used : DrainOperation(com.hazelcast.concurrent.semaphore.operations.DrainOperation) 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