/// <summary> /// 得到连接状态 /// </summary> /// <returns></returns> public string GetState() { if (_zooKeeper != null) { ZooKeeper.States states = _zooKeeper.getState(); return(states.ToString()); } return(_fail); }
/// <summary> /// 得到连接状态 /// </summary> /// <returns></returns> public string GetState() { try { if (_zooKeeper != null) { ZooKeeper.States states = _zooKeeper.getState(); return(states.ToString()); } } catch (Exception ex) { _log.ErrorFormat("获取zookeeper连接状态发生异常:{0}", ex.Message + ex.StackTrace); } return(_fail); }