Пример #1
0
 public void SyncToLocal()
 {
     if (ZkSerialization.Enable)
     {
         var str = ZkSerialization.Serialize(ZkCache);
         File.WriteAllText(LocalZkFilePath, str);
     }
 }
Пример #2
0
        public void Init()
        {
            var ret = RetryOperation(() =>
            {
                return(Zookeeper.Exists("/", false) != null);
            });

            if (!ret)
            {
                if (ZkSerialization.Enable)
                {
                    var str = File.ReadAllText(LocalZkFilePath);
                    ZkSerialization.Deserilize(ZkCache, str);
                }
            }
        }