Search in sources :

Example 1 with WaitingForClusterModel

use of com.linkedin.kafka.cruisecontrol.async.progress.WaitingForClusterModel in project cruise-control by linkedin.

the class LoadMonitor method acquireForModelGeneration.

/**
 * Acquire the semaphore for the cluster model generation.
 * @param operationProgress the progress for the job.
 * @throws InterruptedException
 */
public AutoCloseableSemaphore acquireForModelGeneration(OperationProgress operationProgress) throws InterruptedException {
    if (_acquiredClusterModelSemaphore.get()) {
        throw new IllegalStateException("The thread has already acquired the semaphore for cluster model generation.");
    }
    WaitingForClusterModel step = new WaitingForClusterModel();
    operationProgress.addStep(step);
    _clusterModelSemaphore.acquire();
    _acquiredClusterModelSemaphore.set(true);
    step.done();
    return new AutoCloseableSemaphore();
}
Also used : WaitingForClusterModel(com.linkedin.kafka.cruisecontrol.async.progress.WaitingForClusterModel)

Aggregations

WaitingForClusterModel (com.linkedin.kafka.cruisecontrol.async.progress.WaitingForClusterModel)1