Example #1
0
            private static WriteBehind GetWriteBehind(Hashtable settings)
            {
                if (settings == null)
                {
                    return(null);
                }

                WriteBehind writeBehind = new WriteBehind();

                if (settings.ContainsKey("mode"))
                {
                    writeBehind.Mode = settings["mode"].ToString();
                }
                if (settings.ContainsKey("throttling-rate-per-sec"))
                {
                    writeBehind.Throttling = settings["throttling-rate-per-sec"].ToString();
                }
                if (settings.ContainsKey("failed-operations-queue-limit"))
                {
                    writeBehind.RequeueLimit = settings["failed-operations-queue-limit"].ToString();
                }
                if (settings.ContainsKey("failed-operations-eviction-ratio"))
                {
                    writeBehind.Eviction = settings["failed-operations-eviction-ratio"].ToString();
                }
                if (settings.ContainsKey("batch-mode-config"))
                {
                    writeBehind.BatchConfig = GetBatchConfig(settings["batch-mode-config"] as Hashtable);
                }

                return(writeBehind);
            }
Example #2
0
        public object Clone()
        {
            WriteBehind writeBehind = new WriteBehind();

            writeBehind.Mode         = Mode != null ? (string)Mode.Clone() : null;
            writeBehind.Throttling   = Throttling != null ? (string)Throttling.Clone() : null;
            writeBehind.Eviction     = Eviction != null ? (string)Eviction.Clone() : null;
            writeBehind.RequeueLimit = RequeueLimit != null ? (string)RequeueLimit.Clone() : null;
            writeBehind.BatchConfig  = BatchConfig != null?BatchConfig.Clone() as BatchConfig : null;

            return(writeBehind);
        }
Example #3
0
 public void Deserialize(Runtime.Serialization.IO.CompactReader reader)
 {
     provider    = reader.ReadObject() as Provider[];
     enabled     = reader.ReadBoolean();
     writeBehind = reader.ReadObject() as WriteBehind;
 }