protected void setCapacity(String workerIdentity, int newExecutorNum, int newWaitQueueSize)
      throws IOException, ServiceException {
    long currentTime = System.currentTimeMillis();
    if (currentTime > nextCheckTime) {
      LlapZookeeperRegistryImpl.ConfigChangeLockResult lockResult =
          registry.lockForConfigChange(currentTime, currentTime + this.minConfigChangeDelayMs);

      LOG.debug("Got result for lock check: {}", lockResult);
      if (lockResult.isSuccess()) {
        LOG.info("Setting capacity for workerIdentity={} to newExecutorNum={}, newWaitQueueSize={}",
            workerIdentity, newExecutorNum, newWaitQueueSize);
        LlapServiceInstance serviceInstance = registry.getInstances().getInstance(workerIdentity);
        LlapManagementProtocolClientImpl client = clientFactory.create(serviceInstance);
        client.setCapacity(null,
            SetCapacityRequestProto.newBuilder()
                .setExecutorNum(newExecutorNum)
                .setQueueSize(newWaitQueueSize)
                .build());
      }
      if (lockResult.getNextConfigChangeTime() > -1L) {
        nextCheckTime = lockResult.getNextConfigChangeTime();
      }
    } else {
      LOG.debug("Skipping check. Current time {} and we are waiting for {}.", currentTime, nextCheckTime);
    }
  }
Implementation of MetricsListener which blacklists slow nodes based on the statistics.
llap-tez/src/java/org/apache/hadoop/hive/llap/tezplugins/metrics/BlacklistingLlapMetricsListener.java