Ejemplo n.º 1
0
        internal ClusterInfo(IServerConfig config)
        {
            //TODO implement deep cloning for better performance
            var poolsCopy = JsonConvert.DeserializeObject<Pools>(JsonConvert.SerializeObject(config.Pools));
            var bucketsCopy = new List<IBucketConfig>(config.Buckets.Count);
            foreach (var bucketConfig in config.Buckets)
            {
                var bucketJson = JsonConvert.SerializeObject(bucketConfig);
                bucketsCopy.Add(JsonConvert.DeserializeObject<BucketConfig>(bucketJson));
            }

            this._pools = poolsCopy;
            this._buckets = bucketsCopy;
        }
 public static Uri GetBucketUri(this Pools pools, Uri baseUri)
 {
     return(FixupUri(baseUri, pools.Buckets.Uri));
 }
Ejemplo n.º 3
0
 public static Uri GetServersGroupUri(this Pools pools, Uri baseUri)
 {
     return(FixupUri(baseUri, pools.ServerGroupsUri));
 }