public void close() {
    leaderElections.forEach(le -> {
      try {
        le.close();
      } catch (Exception e) {
        HiveMetaStore.LOG.warn("Error closing election: " + le.getName(), e);
      }
    });
  }
Types of tasks that exactly have one instance in a given warehouse.
For those tasks which belong to the same type, they will be running in the same leader.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/leader/LeaderElectionContext.java