Пример #1
0
        public void Subscribe()
        {
            var w = new watcher();
            var zk = new ZooKeeper("", TimeSpan.FromSeconds(1), w);
            w.WaitUntilConnected(1);

            zk.GetData("", w, new Stat());
        }
Пример #2
0
        public void Subscribe()
        {
            var w  = new watcher();
            var zk = new ZooKeeper("", TimeSpan.FromSeconds(1), w);

            w.WaitUntilConnected(1);

            zk.GetData("", w, new Stat());
        }
Пример #3
0
        public CollectionClusterState GetClusterState(string zkHost, string collectionName)
        {
            var w = new watcher();
            var zk = new ZooKeeper(zkHost, TimeSpan.FromSeconds(1), w);
            w.WaitUntilConnected(1);

            //var nodes = zk.GetChildren("/live_nodes", false).ToList();

            var clusterState = zk.GetData("/clusterstate.json", false, null);
            var json = Encoding.Default.GetString(clusterState);

            ClusterState state = ClusterState.FromJson(json);

            return new CollectionClusterState(state.Collections[collectionName]);
        }
Пример #4
0
        public CollectionClusterState GetClusterState(string zkHost, string collectionName)
        {
            var w  = new watcher();
            var zk = new ZooKeeper(zkHost, TimeSpan.FromSeconds(1), w);

            w.WaitUntilConnected(1);

            //var nodes = zk.GetChildren("/live_nodes", false).ToList();

            var clusterState = zk.GetData("/clusterstate.json", false, null);
            var json         = Encoding.Default.GetString(clusterState);

            ClusterState state = ClusterState.FromJson(json);

            return(new CollectionClusterState(state.Collections[collectionName]));
        }