コード例 #1
0
 public RoundRobinRoutingStrategy(ClientConfig config, Cluster cluster)
 {
     if (null == config) throw new ArgumentNullException("config", "config cannot be null.");
     if (null == cluster) throw new ArgumentNullException("cluster", "cluster cannot be null.");
     _Config = config;
     _Cluster = cluster;
 }
コード例 #2
0
ファイル: Cluster.cs プロジェクト: jcustenborder/voldemort
        public static void Save(Cluster cluster, string FilePath)
        {
            if (null == cluster) throw new ArgumentNullException("cluster", "cluster cannot be null.");
            if (string.IsNullOrEmpty(FilePath)) throw new ArgumentNullException("FilePath", "FilePath cannot be null.");

            using (System.IO.FileStream iostr = new System.IO.FileStream(FilePath, FileMode.Create, FileAccess.Write))
            {
                Save(cluster, iostr);
            }
        }
コード例 #3
0
        public RoutedStore(string storeName,
                    ClientConfig config,
                    Cluster cluster,
                    IDictionary<int, Store> clusterMap,
                    RoutingStrategy routingStrategy)
        {
            if (string.IsNullOrEmpty(storeName)) throw new ArgumentNullException("storeName", "storeName cannot be null.");
            if (null == config) throw new ArgumentNullException("config", "config cannot be null.");
            if (null == cluster) throw new ArgumentNullException("cluster", "cluster cannot be null.");
            if (null == clusterMap) throw new ArgumentNullException("clusterMap", "clusterMap cannot be null.");
            if (null == routingStrategy) throw new ArgumentNullException("routingStrategy", "routingStrategy cannot be null.");


            _storeName = storeName;
            _config = config;
            _cluster = cluster;
            _clusterMap = clusterMap;
            _routingStrategy = routingStrategy;
        }
コード例 #4
0
ファイル: Cluster.cs プロジェクト: jcustenborder/voldemort
 public static void Save(Cluster cluster, Stream stream)
 {
     if (null == cluster) throw new ArgumentNullException("cluster", "cluster cannot be null.");
     if (null == stream) throw new ArgumentNullException("stream", "stream cannot be null.");
     Serializer.Serialize(stream, cluster);
 }