示例#1
0
 public static string CreateZK(string path, string connStr, ref string ErrorMessage)
 {
     try
     {
         ZooKeeper zooKeeper = ZooKClient.GetZooKeeper();
         string    strResult = zooKeeper.Create(path, connStr.GetBytes(), Ids.OPEN_ACL_UNSAFE, CreateMode.Persistent);
         return(strResult);
     }
     catch (Exception exception)
     {
         ErrorMessage = exception.Message + "|" + exception.StackTrace;
     }
     return("");
 }
示例#2
0
        public static string GetZK(string path, ref string ErrorMessage)
        {
            string str = string.Empty;

            try
            {
                ZooKeeper zooKeeper = ZooKClient.GetZooKeeper();
                str = UserInfoSecurity.DBDecy(Encoding.UTF8.GetString(zooKeeper.GetData(path, null, null)));
            }
            catch (Exception exception)
            {
                ErrorMessage = exception.Message + "|" + exception.StackTrace;
            }
            return(str);
        }