Ejemplo n.º 1
0
            private static Cluster GetCluster(Hashtable settings)
            {
                Cluster cluster = new Cluster();
                if (settings.ContainsKey("type"))
                {
                    cluster.Topology = settings["type"].ToString();
                }
                if (settings.ContainsKey("stats-repl-interval"))
                    cluster.StatsRepInterval = Convert.ToInt32(settings["stats-repl-interval"]);
                if (settings.ContainsKey("op-timeout"))
                    cluster.OpTimeout = Convert.ToInt32(settings["op-timeout"]);
                if (settings.ContainsKey("use-heart-beat"))
                    cluster.UseHeartbeat = Convert.ToBoolean(settings["use-heart-beat"]);

                settings = (Hashtable)settings["cluster"];
                if (settings.ContainsKey("channel"))
                    cluster.Channel = GetChannel((Hashtable)settings["channel"],  1);

                return cluster;
            }
Ejemplo n.º 2
0
        public object Clone()
        {
            Cluster cluster = new Cluster();
            cluster.topology = this.topology != null ? (string) this.topology.Clone(): null;
            cluster.OpTimeout = OpTimeout;
            cluster.StatsRepInterval = StatsRepInterval;
            cluster.UseHeartbeat = UseHeartbeat;
            
            if (nodes != null)
            {

                cluster.nodes = new Dictionary<NodeIdentity, StatusInfo>();
                foreach (KeyValuePair<NodeIdentity, StatusInfo> pair in nodes)
                {
                    cluster.nodes.Add(pair.Key, pair.Value);
                }

            }

            cluster.Channel = Channel != null ? (Channel) Channel.Clone(): null;
            return cluster;
        }
Ejemplo n.º 3
0
        public void Deserialize(Runtime.Serialization.IO.CompactReader reader)
        {           
            cacheIsRunning=  reader.ReadBoolean();
            cacheIsRegistered = reader.ReadBoolean();
            licenseIsExpired = reader.ReadBoolean();
            name = reader.ReadObject() as string;
            inproc = reader.ReadBoolean();
            configID = reader.ReadDouble();
            lastModified = reader.ReadObject() as string;
            cacheType = reader.ReadObject() as string;
            log = reader.ReadObject() as Log;
            perfCounters = reader.ReadObject() as PerfCounters;
            autoBalancing = reader.ReadObject() as AutoLoadBalancing;
            indexes = reader.ReadObject() as QueryIndex;
            cleanup = reader.ReadObject() as Cleanup;
            storage = reader.ReadObject() as Storage;
            evictionPolicy = reader.ReadObject() as EvictionPolicy;
            cluster = reader.ReadObject() as Cluster;            
            clientNodes = reader.ReadObject() as ClientNodes;
            _runtimeContextValue = reader.ReadObject() as string == "1" ? RtContextValue.JVCACHE : RtContextValue.NCACHE;

        }