Inheritance: Enyim.Caching.Memcached.Protocol.Binary.BinaryNode
コード例 #1
0
        private Tuple <VBucket, CouchbaseNode[], IObserveOperation> setupObserveOperation(ICouchbaseServerPool pool)
        {
            var vbucket = pool.GetVBucket(_settings.Key);
            var command = pool.OperationFactory.Observe(_settings.Key, vbucket.Index, _settings.Cas);

            var workingNodes = pool.GetWorkingNodes().ToArray();

            var masterAndReplicaNodes = new CouchbaseNode[vbucket.Replicas.Count() + 1];

            masterAndReplicaNodes[0] = workingNodes[vbucket.Master] as CouchbaseNode;

            for (var i = 0; i < vbucket.Replicas.Length; i++)
            {
                masterAndReplicaNodes[i + 1] = workingNodes[vbucket.Replicas[i]] as CouchbaseNode;
            }

            return(Tuple.Create(vbucket, masterAndReplicaNodes, command));
        }
コード例 #2
0
        private Tuple<VBucket, CouchbaseNode[], IObserveOperation> setupObserveOperation(ICouchbaseServerPool pool)
        {
            var vbucket = pool.GetVBucket(_settings.Key);
            var command = pool.OperationFactory.Observe(_settings.Key, vbucket.Index, _settings.Cas);

            var workingNodes = pool.GetWorkingNodes().ToArray();

            var masterAndReplicaNodes = new CouchbaseNode[vbucket.Replicas.Count() + 1];

            masterAndReplicaNodes[0] = workingNodes[vbucket.Master] as CouchbaseNode;

            for (var i = 0; i < vbucket.Replicas.Length; i++)
            {
                masterAndReplicaNodes[i + 1] = workingNodes[vbucket.Replicas[i]] as CouchbaseNode;
            }

            return Tuple.Create(vbucket, masterAndReplicaNodes, command);
        }