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)); }
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); }