Search in sources :

Example 1 with SemaphoreContainer

use of com.hazelcast.concurrent.semaphore.SemaphoreContainer in project hazelcast by hazelcast.

the class AvailableOperation method run.

@Override
public void run() throws Exception {
    SemaphoreContainer semaphoreContainer = getSemaphoreContainer();
    response = semaphoreContainer.getAvailable();
}
Also used : SemaphoreContainer(com.hazelcast.concurrent.semaphore.SemaphoreContainer)

Example 2 with SemaphoreContainer

use of com.hazelcast.concurrent.semaphore.SemaphoreContainer in project hazelcast by hazelcast.

the class DrainBackupOperation method run.

@Override
public void run() throws Exception {
    SemaphoreContainer semaphoreContainer = getSemaphoreContainer();
    semaphoreContainer.drain(firstCaller);
    response = true;
}
Also used : SemaphoreContainer(com.hazelcast.concurrent.semaphore.SemaphoreContainer)

Example 3 with SemaphoreContainer

use of com.hazelcast.concurrent.semaphore.SemaphoreContainer in project hazelcast by hazelcast.

the class DrainOperation method run.

@Override
public void run() throws Exception {
    SemaphoreContainer semaphoreContainer = getSemaphoreContainer();
    response = semaphoreContainer.drain(getCallerUuid());
}
Also used : SemaphoreContainer(com.hazelcast.concurrent.semaphore.SemaphoreContainer)

Example 4 with SemaphoreContainer

use of com.hazelcast.concurrent.semaphore.SemaphoreContainer in project hazelcast by hazelcast.

the class InitOperation method run.

@Override
public void run() throws Exception {
    SemaphoreContainer semaphoreContainer = getSemaphoreContainer();
    response = semaphoreContainer.init(permitCount);
}
Also used : SemaphoreContainer(com.hazelcast.concurrent.semaphore.SemaphoreContainer)

Example 5 with SemaphoreContainer

use of com.hazelcast.concurrent.semaphore.SemaphoreContainer in project hazelcast by hazelcast.

the class ReduceBackupOperation method run.

@Override
public void run() throws Exception {
    SemaphoreContainer semaphoreContainer = getSemaphoreContainer();
    semaphoreContainer.reduce(permitCount);
    response = true;
}
Also used : SemaphoreContainer(com.hazelcast.concurrent.semaphore.SemaphoreContainer)

Aggregations

SemaphoreContainer (com.hazelcast.concurrent.semaphore.SemaphoreContainer)16 SemaphoreService (com.hazelcast.concurrent.semaphore.SemaphoreService)3 ILogger (com.hazelcast.logging.ILogger)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1