public synchronized void addUsedWorker(ServerName worker) {
    // load used worker when master restart
    currentWorkers.compute(worker, (serverName,
      availableWorker) -> availableWorker == null ? maxTasks - 1 : availableWorker - 1);
  }
help assign and release a worker for each remote task. For each worker, concurrent running task
should be no more than maxTasks. If a task failed to acquire a worker, it will suspend and wait
for workers available.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/WorkerAssigner.java