public synchronized void setBarrier(String queryId, String requestingServer, String doAs, boolean doAsAdmin)
        throws Exception {
      try {
        KillQueryZookeeperData data = new KillQueryZookeeperData(queryId, requestingServer, doAs, doAsAdmin);
        client.create().creatingParentContainersIfNeeded()
            .forPath(barrierPath, data.toString().getBytes(StandardCharsets.UTF_8));
      } catch (KeeperException.NodeExistsException e) {
        throw new IllegalStateException("Barrier with this path already exists");
      }
    }
Utility to set the barrier node.

@throws Exception errors
service/src/java/org/apache/hive/service/server/KillQueryZookeeperManager.java