@Override
  public void waitForOperations() {
    boolean interrupted = false;
    while (!executor.isShutdown()) {
      try {
        if (operationSemaphore.tryAcquire(maxParallelOperations, 1, TimeUnit.SECONDS)) {
          operationSemaphore.release(maxParallelOperations);

          drainCompletions();

          if (interrupted) {
            Thread.currentThread().interrupt();
          }

          return;
        }
      } catch (InterruptedException e) {
        interrupted = true;
      }
    }
  }
Wait for any pending operations, and notify the the completions that the operations and done.
geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/rebalance/ParallelBucketOperator.java