@Override
    public void execute() {
      try {
        HiveConf hiveConf = new HiveConf();
        HS2ActivePassiveHARegistry haRegistry = HS2ActivePassiveHARegistryClient.getClient(hiveConf);
        HS2Peers.HS2Instances hs2Instances = new HS2Peers.HS2Instances(haRegistry.getAll());
        String jsonOut = hs2Instances.toJson();
        System.out.println(jsonOut);
      } catch (IOException e) {
        LOG.error("Error listing HiveServer2 HA instances from ZooKeeper", e);
        System.err.println("Error listing HiveServer2 HA instances from ZooKeeper" + e);
        System.exit(-1);
      }
      System.exit(0);
    }
Handler for --failover <workerIdentity> command. The way failover works is,
- the client gets <workerIdentity> from user input
- the client uses HS2 HA registry to get list of HS2 instances and finds the one that matches <workerIdentity>
- if there is a match, client makes sure the instance is a leader (only leader can failover)
- if the matched instance is a leader, its web endpoint is obtained from service record then http DELETE method
  is invoked on /leader endpoint (Yes. Manual failover requires web UI to be enabled)
- the webpoint checks if admin ACLs are set, if so will close and restart the leader latch triggering a failover
service/src/java/org/apache/hive/service/server/HiveServer2.java