@Override
  public synchronized void start() {
    super.start();
    if (zooKeeperClient == null) {
      throw new ServiceException("Failed start zookeeperClient in KillQueryZookeeperManager");
    }
    try {
      ZookeeperUtils.setupZookeeperAuth(this.getHiveConf(), SASL_LOGIN_CONTEXT_NAME, zkPrincipal, zkKeytab);
      zooKeeperClient.start();
      try {
        zooKeeperClient.create().creatingParentsIfNeeded().withMode(CreateMode.PERSISTENT).forPath("/" + zkNameSpace);
        if (ZookeeperUtils.isKerberosEnabled(conf)) {
          zooKeeperClient.setACL().withACL(createSecureAcls()).forPath("/" + zkNameSpace);
        }
        LOG.info("Created the root namespace: " + zkNameSpace + " on ZooKeeper");
      } catch (KeeperException e) {
        if (e.code() != KeeperException.Code.NODEEXISTS) {
          LOG.error("Unable to create namespace: " + zkNameSpace + " on ZooKeeper", e);
          throw e;
        }
      }
      // Create a path cache and start to listen for every kill query request from other servers.
      killQueryListener = new PathChildrenCache(zooKeeperClient, "/" + zkNameSpace, false);
      killQueryListener.start(PathChildrenCache.StartMode.NORMAL);
      startListeningForQueries();
      // Init closeable utils in case register is not called (see HIVE-13322)
      CloseableUtils.class.getName();
    } catch (Exception e) {
      throw new RuntimeException("Failed start zookeeperClient in KillQueryZookeeperManager", e);
    }
    LOG.info("KillQueryZookeeperManager service started.");
  }
Kill query coordination service.
When service discovery is enabled a local kill query can request a kill
on every other HS2 server with the queryId or queryTag and wait for confirmation on denial.
The communication is done through Zookeeper.
service/src/java/org/apache/hive/service/server/KillQueryZookeeperManager.java