private boolean isZookeeperLeader(String nodeIP,int port){
  try {
    Socket sock=new Socket();
    sock.connect(new InetSocketAddress(nodeIP,port),10000);
    sock.close();
    return true;
  }
 catch (  IOException ex) {
    _log.warn("Unexpected IO errors when checking local coordinator state. {}",ex.toString());
  }
  return false;
}

private boolean isZookeeperLeader ( String nodeIP , int port ) { try { Socket sock = new Socket ( ) ; sock . connect ( new InetSocketAddress ( nodeIP , port ) , 10000 ) ; sock . close ( ) ; return true ; } catch ( IOException ex ) { _log . warn ( "Unexpected IO errors when checking local coordinator state. {}" , ex . toString ( ) ) ; } return false ; }
zookeeper leader nodes listens on 2888 ( see coordinator - var . xml ) for follower / observers . we depends on this behaviour to check if leader election is started
