@VisibleForTesting
  void init(Configuration conf, LlapRegistryService registry, LlapManagementProtocolClientImplFactory clientFactory) {
    this.registry = registry;
    this.clientFactory = clientFactory;
    this.minServedTasksNumber =
        HiveConf.getIntVar(conf, HiveConf.ConfVars.LLAP_NODEHEALTHCHECKS_MINTASKS);
    this.minConfigChangeDelayMs =
        HiveConf.getTimeVar(conf, HiveConf.ConfVars.LLAP_NODEHEALTHCHECKS_MININTERVALDURATION,
            TimeUnit.MILLISECONDS);
    this.timeThreshold =
        HiveConf.getFloatVar(conf, HiveConf.ConfVars.LLAP_NODEHEALTHCHECKS_TASKTIMERATIO);
    this.emptyExecutorsThreshold =
        HiveConf.getFloatVar(conf,
            HiveConf.ConfVars.LLAP_NODEHEALTHCHECKS_EXECUTORRATIO);
    this.maxBlacklistedNodes =
        HiveConf.getIntVar(conf, HiveConf.ConfVars.LLAP_NODEHEALTHCHECKS_MAXNODES);

    Preconditions.checkArgument(minServedTasksNumber > 0,
        "Minimum served tasks should be greater than 0");
    Preconditions.checkArgument(minConfigChangeDelayMs > 0,
        "Minimum config change delay should be greater than 0");
    Preconditions.checkArgument(timeThreshold > 1.0f,
        "The time threshold should be greater than 1");
    Preconditions.checkArgument(maxBlacklistedNodes > 0,
        "The maximum number of blacklisted node should be greater than 1");
    Preconditions.checkNotNull(registry, "Registry should not be null");
    Preconditions.checkNotNull(clientFactory, "ClientFactory should not be null");

    LOG.info("BlacklistingLlapMetricsListener initialized with " +
                  "minServedTasksNumber={}, " +
                  "minConfigChangeDelayMs={}, " +
                  "timeThreshold={}, " +
                  "emptyExecutorsThreshold={}, " +
                  "maxBlacklistedNodes={}",
        minServedTasksNumber, minConfigChangeDelayMs, timeThreshold, emptyExecutorsThreshold, maxBlacklistedNodes);
  }
Implementation of MetricsListener which blacklists slow nodes based on the statistics.
llap-tez/src/java/org/apache/hadoop/hive/llap/tezplugins/metrics/BlacklistingLlapMetricsListener.java