Esempio n. 1
0
        public void T110_PriorityCollideWithMaxCap()
        {
            using (var cache = PileCacheTestCore.MakeCache())
            {
                var tA = cache.GetOrCreateTable <int>("A");
                tA.Options.MaximumCapacity = 7;

                const int CNT = 4000;
                var       lst = new List <PutResult>();
                for (var i = 0; i < CNT; i++)
                {
                    var pr = tA.Put(i, "value" + i.ToString(), priority: 10);               //PRIORITY +10!
                    //  Console.WriteLine("{0} -> {1}", i, pr);
                    Assert.IsTrue(pr == PutResult.Inserted || pr == PutResult.Overwritten); //the table is capped, so some values will be overwritten
                    lst.Add(pr);
                }

                Assert.IsTrue(lst.Count(r => r == PutResult.Inserted) > 0);
                Assert.IsTrue(lst.Count(r => r == PutResult.Overwritten) > 0);

                lst.Clear();
                for (var i = CNT; i < 2 * CNT; i++)
                {
                    var pr = tA.Put(i, "value" + i.ToString(), priority: -10);//only collision, because priority is lowe r than what already exists
                    //  Console.WriteLine("{0} -> {1}", i, pr);
                    Assert.IsTrue(pr == PutResult.Collision);
                    lst.Add(pr);
                }
            }
        }
Esempio n. 2
0
        public void T090_PutGetWithMaxCap()
        {
            using (var cache = PileCacheTestCore.MakeCache())
            {
                var tA = cache.GetOrCreateTable <int>("A");
                tA.Options.MaximumCapacity = 7;

                const int CNT = 4000;
                var       lst = new List <PutResult>();
                for (var i = 0; i < CNT; i++)
                {
                    var pr = tA.Put(i, "value" + i.ToString(), priority: 10);
                    //  Console.WriteLine("{0} -> {1}", i, pr);
                    Assert.IsTrue(pr == PutResult.Inserted || pr == PutResult.Overwritten);//the table is capped, so some values will be overwritten

                    lst.Add(pr);
                }

                Assert.IsTrue(lst.Count(r => r == PutResult.Inserted) > 0);
                Assert.IsTrue(lst.Count(r => r == PutResult.Overwritten) > 0);


                for (var i = 0; i < CNT; i++)
                {
                    var v = tA.Get(i);
                    //  Console.WriteLine("{0} -> {1}", i, v);
                    Assert.IsTrue(v == null || v.Equals("value" + i.ToString()));
                }
            }
        }
Esempio n. 3
0
 public void T030_Comparers()
 {
     using (var cache = PileCacheTestCore.MakeCache())
     {
         var tA = cache.GetOrCreateTable <string>("A", StringComparer.Ordinal);
         var tB = cache.GetOrCreateTable <string>("A", StringComparer.OrdinalIgnoreCase);
     }
 }
Esempio n. 4
0
        public void T010_MainOperations()
        {
            using (var cache = PileCacheTestCore.MakeCache())
            {
                var tA = cache.GetOrCreateTable <string>("A");
                var tB = cache.GetOrCreateTable <string>("B");

                Assert.IsNotNull(tA);
                Assert.IsNotNull(tB);

                Assert.AreEqual(2, cache.Tables.Count);

                Assert.AreEqual(0, tA.Count);
                Assert.AreEqual(0, tB.Count);

                Assert.AreEqual(PutResult.Inserted, tA.Put("key1", "avalue1"));
                Assert.AreEqual(PutResult.Inserted, tA.Put("key2", "avalue2"));
                Assert.AreEqual(PutResult.Inserted, tB.Put("key1", "bvalue1"));

                Assert.AreEqual(3, cache.Count);
                Assert.AreEqual(2, tA.Count);
                Assert.AreEqual(1, tB.Count);

                Assert.IsTrue(tA.ContainsKey("key1"));
                Assert.IsTrue(tA.ContainsKey("key2"));
                Assert.IsFalse(tA.ContainsKey("key3 that was never put"));

                Assert.IsTrue(tB.ContainsKey("key1"));
                Assert.IsFalse(tB.ContainsKey("key2"));


                Assert.AreEqual("avalue1", tA.Get("key1"));
                Assert.AreEqual("avalue2", tA.Get("key2"));
                Assert.AreEqual(null, tA.Get("key3"));

                Assert.AreEqual("bvalue1", tB.Get("key1"));

                Assert.AreEqual("avalue1", cache.GetTable <string>("A").Get("key1"));
                Assert.AreEqual("bvalue1", cache.GetTable <string>("B").Get("key1"));

                Assert.IsTrue(tA.Remove("key1"));
                Assert.IsFalse(tA.Remove("key2342341"));

                Assert.AreEqual(2, cache.Count);
                Assert.AreEqual(1, tA.Count);
                Assert.AreEqual(1, tB.Count);

                cache.PurgeAll();
                Assert.AreEqual(0, cache.Count);
                Assert.AreEqual(0, tA.Count);
                Assert.AreEqual(0, tB.Count);

                Assert.AreEqual(0, cache.Pile.UtilizedBytes);
                Assert.AreEqual(0, cache.Pile.ObjectCount);
            }
        }
Esempio n. 5
0
        public void SweepOldRejuvenateSome(int COUNT)
        {
            using (var cache = PileCacheTestCore.MakeDurableCache())
            {
                var tA = cache.GetOrCreateTable <long>("A");

                for (var i = 0; i < COUNT; i++)
                {
                    var key   = i * 7;
                    var value = "value of " + i.ToString();
                    var pr    = tA.Put(key, value, maxAgeSec: 20);
                    Aver.AreObjectEqualTest(PutResult.Inserted, pr);
                }

                Aver.AreEqual(COUNT, tA.Count);

                const int WAIT = 45;
                for (var j = 0; j < WAIT; j++)
                {
                    Console.WriteLine("Wait loop iteration #{0} of {1}", j, WAIT);
                    for (var i = 0; i < COUNT; i++)
                    {
                        var odd = (i & 1) != 0;
                        if (odd)
                        {
                            continue;//do not rejuvenate ODD
                        }
                        var key = i * 7;
                        Aver.IsTrue(tA.Rejuvenate(key));
                    }
                    Thread.Sleep(1000);
                }

                for (var i = 0; i < COUNT; i++)
                {
                    var key   = i * 7;
                    var value = "value of " + i.ToString();
                    var odd   = (i & 1) != 0;
                    var got   = tA.Get(key) as string;

                    if (odd)
                    {
                        Aver.IsNull(got);
                    }
                    else
                    {
                        Aver.AreEqual(value, got);
                    }
                }

                Aver.AreEqual(COUNT / 2, cache.Pile.ObjectCount);//Half of objects died
            }
        }
Esempio n. 6
0
        public void AddAndRemove(int COUNT, int durationSec, double delMargin)
        {
            using (var cache = PileCacheTestCore.MakeDurableCache())
            {
                var tA   = cache.GetOrCreateTable <Guid>("A");
                var dict = new Dictionary <Guid, string>();

                var sw = System.Diagnostics.Stopwatch.StartNew();
                var ls = 0L;
                while (sw.Elapsed.TotalSeconds < durationSec)
                {
                    while (dict.Count < COUNT)
                    {
                        var key   = Guid.NewGuid();
                        var value = "value is " + key;
                        dict.Add(key, value);

                        var pr = tA.Put(key, value);
                        Aver.AreObjectsEqual(PutResult.Inserted, pr);
                    }

                    var todelete = ExternalRandomGenerator.Instance.NextScaledRandomInteger(0, (int)(COUNT * delMargin));
                    for (var i = 0; i < todelete; i++)
                    {
                        var key = dict.Keys.Skip(ExternalRandomGenerator.Instance.NextScaledRandomInteger(0, dict.Count - 2)).First();
                        Aver.IsTrue(dict.Remove(key));
                        Aver.IsTrue(tA.Remove(key));
                        Aver.AreEqual(dict.Count, tA.Count);
                    }

                    if (sw.ElapsedMilliseconds - ls > 1000)
                    {
                        Console.WriteLine("Elapsed: {0:n0} of {1:n0};   Removed {2:n0}, count is {3:n0}", sw.Elapsed.TotalSeconds, durationSec, todelete, tA.Count);
                        ls = sw.ElapsedMilliseconds;
                    }

                    Aver.AreEqual(dict.Count, tA.Count);
                    foreach (var kvp in  dict)
                    {
                        Aver.AreEqual(kvp.Value, tA.Get(kvp.Key) as string);
                    }
                }

                //delete everything
                foreach (var kvp in dict)
                {
                    Aver.IsTrue(tA.ContainsKey(kvp.Key));
                    Aver.IsTrue(tA.Remove(kvp.Key));
                    Aver.IsFalse(tA.ContainsKey(kvp.Key));
                }
                Aver.AreEqual(0, cache.Pile.ObjectCount);//Pile is empty
            }
        }
Esempio n. 7
0
        public void T180_GetOrPut()
        {
            using (var cache = PileCacheTestCore.MakeCache())
            {
                var tA = cache.GetOrCreateTable <int>("A");

                tA.Put(1, "value 1");
                tA.Put(122, "value 122");

                PutResult?pResult;
                var       v = tA.GetOrPut(2, (t, k, _) => "value " + k.ToString(), null, out pResult);
                Assert.AreEqual("value 2", v);
                Assert.IsTrue(pResult.HasValue);
                Assert.AreEqual(PutResult.Inserted, pResult.Value);

                Assert.AreEqual(3, tA.Count);
                tA.Put(1, "value 1");
                tA.Put(2, "value 2");
                tA.Put(122, "value 122");


                v = tA.GetOrPut(1, (t, k, _) => "value " + k.ToString(), null, out pResult);
                Assert.AreEqual("value 1", v);
                Assert.IsFalse(pResult.HasValue);

                Assert.AreEqual(3, tA.Count);
                tA.Put(1, "value 1");
                tA.Put(2, "value 2");
                tA.Put(122, "value 122");

                v = tA.GetOrPut(777, (t, k, _) => "value " + k.ToString(), null, out pResult);
                Assert.AreEqual("value 777", v);
                Assert.IsTrue(pResult.HasValue);
                Assert.AreEqual(PutResult.Inserted, pResult.Value);


                Assert.AreEqual(4, tA.Count);
                tA.Put(1, "value 1");
                tA.Put(2, "value 2");
                tA.Put(122, "value 122");
                tA.Put(777, "value 777");

                pResult = tA.Put(2, "mod value 2");
                Assert.AreEqual(PutResult.Replaced, pResult.Value);


                Assert.AreEqual(4, tA.Count);
                tA.Put(1, "value 1");
                tA.Put(2, "mod value 2");
                tA.Put(122, "value 122");
                tA.Put(777, "value 777");
            }
        }
Esempio n. 8
0
        public void BasicSpeculative(int COUNT)
        {
            using (var cache = PileCacheTestCore.MakeCache())
            {
                var tA = cache.GetOrCreateTable <Guid>("A");

                Aver.AreObjectsEqual(CollisionMode.Speculative, tA.CollisionMode);

                var dict = new Dictionary <Guid, PilePointer>();

                for (var i = 0; i < COUNT; i++)
                {
                    var key = Guid.NewGuid();
                    var ptr = cache.Pile.Put(key.ToString(), preallocateBlockSize: 1024);
                    dict.Add(key, ptr);

                    var pr = tA.PutPointer(key, ptr);
                    Aver.IsTrue(PutResult.Inserted == pr || PutResult.Overwritten == pr);
                }

                var ratio = tA.Count / (double)COUNT;
                Console.WriteLine(ratio);
                Aver.IsTrue(ratio > 0.85d);


                foreach (var kvp in dict)
                {
                    var gotPointer = tA.GetPointer(kvp.Key);
                    if (!gotPointer.Valid)
                    {
                        continue;
                    }

                    Aver.AreEqual(gotPointer, kvp.Value);

                    var gotObject = tA.Get(kvp.Key) as string;
                    Aver.IsNotNull(gotObject);

                    Aver.AreEqual(kvp.Key.ToString(), gotObject);
                }

                foreach (var kvp in dict)
                {
                    tA.Remove(kvp.Key);
                }

                Aver.AreEqual(0, tA.Count);
                Aver.AreEqual(0, cache.Pile.ObjectCount);
            }
        }
Esempio n. 9
0
        public void BasicDurable(int COUNT)
        {
            using (var cache = PileCacheTestCore.MakeDurableCache())
            {
                var tA = cache.GetOrCreateTable <Guid>("A");

                Aver.AreObjectsEqual(CollisionMode.Durable, tA.CollisionMode);

                var dict = new Dictionary <Guid, PilePointer>();

                for (var i = 0; i < COUNT; i++)
                {
                    var key = Guid.NewGuid();
                    var ptr = cache.Pile.Put(key.ToString(), preallocateBlockSize: 1024);
                    dict.Add(key, ptr);

                    Aver.IsTrue(PutResult.Inserted == tA.PutPointer(key, ptr));
                }

                Aver.AreEqual(COUNT, tA.Count);

                foreach (var kvp in dict)
                {
                    var gotPointer = tA.GetPointer(kvp.Key);
                    Aver.IsTrue(gotPointer.Valid);

                    Aver.AreEqual(gotPointer, kvp.Value);

                    var gotObject = tA.Get(kvp.Key) as string;
                    Aver.IsNotNull(gotObject);

                    Aver.AreEqual(kvp.Key.ToString(), gotObject);
                }

                //because there is durable chaining, object count in pile is greater than in table
                Aver.IsTrue(COUNT <= cache.Pile.ObjectCount);

                foreach (var kvp in dict)
                {
                    Aver.IsTrue(tA.Remove(kvp.Key));
                }

                Aver.AreEqual(0, tA.Count);
                Aver.AreEqual(0, cache.Pile.ObjectCount);
            }
        }
Esempio n. 10
0
        public void AddAndRetainAll(int COUNT)
        {
            using (var cache = PileCacheTestCore.MakeDurableCache())
            {
                var tA = cache.GetOrCreateTable <Guid>("A");
                var tB = cache.GetOrCreateTable <string>("B");

                Aver.AreObjectsEqual(CollisionMode.Durable, tA.CollisionMode);
                Aver.AreObjectsEqual(CollisionMode.Durable, tB.CollisionMode);


                var dict = new Dictionary <Guid, string>();

                for (var i = 0; i < COUNT; i++)
                {
                    var key   = Guid.NewGuid();
                    var value = "this is a value of " + key;
                    dict.Add(key, value);

                    var pr = tA.Put(key, value);
                    Aver.IsTrue(PutResult.Inserted == pr);

                    pr = tB.Put(key.ToString(), value);
                    Aver.IsTrue(PutResult.Inserted == pr);
                }

                Aver.AreEqual(COUNT, dict.Count);
                Aver.AreEqual(COUNT, tA.Count);
                Aver.AreEqual(COUNT, tB.Count);

                foreach (var kvp in  dict)
                {
                    Aver.IsTrue(tA.ContainsKey(kvp.Key));
                    Aver.AreEqual(kvp.Value, tA.Get(kvp.Key) as string);
                    Aver.AreEqual(kvp.Value, tB.Get(kvp.Key.ToString()) as string);
                }
            }
        }
Esempio n. 11
0
        public void SweepOld(int COUNT)
        {
            using (var cache = PileCacheTestCore.MakeDurableCache())
            {
                var tA = cache.GetOrCreateTable <long>("A");

                for (var i = 0; i < COUNT; i++)
                {
                    var key   = i * 7;
                    var value = "value of " + i.ToString();
                    var odd   = (i & 1) != 0;
                    var pr    = tA.Put(key, value, maxAgeSec: odd ? 1 : 0);
                    Aver.AreObjectEqualTest(PutResult.Inserted, pr);
                }

                Aver.AreEqual(COUNT, tA.Count);
                Thread.Sleep(15000);

                for (var i = 0; i < COUNT; i++)
                {
                    var key   = i * 7;
                    var value = "value of " + i.ToString();
                    var odd   = (i & 1) != 0;
                    var got   = tA.Get(key) as string;

                    if (odd)
                    {
                        Aver.IsNull(got);
                    }
                    else
                    {
                        Aver.AreEqual(value, got);
                    }
                }

                Aver.AreEqual(COUNT / 2, cache.Pile.ObjectCount);//Half of objects died
            }
        }
Esempio n. 12
0
        public void T020_Comparers()
        {
            using (var cache = PileCacheTestCore.MakeCache())
            {
                var tA = cache.GetOrCreateTable <string>("A", StringComparer.Ordinal);
                var tB = cache.GetOrCreateTable <string>("B", StringComparer.OrdinalIgnoreCase);

                Assert.AreEqual(PutResult.Inserted, tA.Put("key1", "avalue1"));
                Assert.AreEqual(PutResult.Inserted, tA.Put("Key1", "avalue2"));
                Assert.AreEqual(PutResult.Inserted, tB.Put("key1", "bvalue1"));
                Assert.AreEqual(PutResult.Replaced, tB.Put("Key1", "bvalue2"));

                Assert.AreEqual(2, tA.Count);
                Assert.AreEqual(1, tB.Count);

                Assert.AreEqual("avalue1", tA.Get("key1"));
                Assert.AreEqual("avalue2", tA.Get("Key1"));
                Assert.AreEqual(null, tA.Get("key3"));

                Assert.AreEqual("bvalue2", tB.Get("key1"));
                Assert.AreEqual("bvalue2", tB.Get("Key1"));
            }
        }
Esempio n. 13
0
        public void T080_PutGetWithoutMaxCap()
        {
            using (var cache = PileCacheTestCore.MakeCache())
            {
                var tA = cache.GetOrCreateTable <int>("A");
                ////   tA.Options.MaximumCapacity = 7;

                const int CNT = 4000;
                for (var i = 0; i < CNT; i++)
                {
                    var pr = tA.Put(i, "value" + i.ToString(), priority: 10);
                    // Console.WriteLine("{0} -> {1}", i, pr);
                    Assert.IsTrue(pr == PutResult.Inserted);//no overwrite because table keeps growing
                }

                for (var i = 0; i < CNT; i++)
                {
                    var v = tA.Get(i);
                    // Console.WriteLine("{0} -> {1}", i, v);
                    Assert.IsTrue(v.Equals("value" + i.ToString()));
                }
            }
        }
Esempio n. 14
0
 public void VarSizes_Increasing_Random(bool isParallel, int cnt, int minSz, int maxSz, bool speed, bool rnd)
 {
     PileCacheTestCore.VarSizes_Increasing_Random(isParallel, cnt, minSz, maxSz, speed, rnd);
 }
Esempio n. 15
0
 public void VarSizes_Checkboard(bool isParallel, int cnt, int minSz, int maxSz, bool speed)
 {
     PileCacheTestCore.VarSizes_Checkboard(isParallel, cnt, minSz, maxSz, speed);
 }
Esempio n. 16
0
        public void AddThenEnumerateAll(int COUNT)
        {
            using (var cache = PileCacheTestCore.MakeDurableCache())
            {
                var tA = cache.GetOrCreateTable <Guid>("A");

                var dict = new Dictionary <Guid, string>();

                for (var i = 0; i < COUNT; i++)
                {
                    var key   = Guid.NewGuid();
                    var value = "this is a value of " + key;
                    dict.Add(key, value);

                    var pr = tA.Put(key, value);
                    Aver.IsTrue(PutResult.Inserted == pr);
                }

                Aver.AreEqual(COUNT, dict.Count);
                Aver.AreEqual(COUNT, tA.Count);

                foreach (var kvp in  dict)
                {
                    Aver.IsTrue(tA.ContainsKey(kvp.Key));
                    Aver.AreEqual(kvp.Value, tA.Get(kvp.Key) as string);
                }

                var hs = new HashSet <Guid>();

                var cnt = 0;
                foreach (var entry in tA.AsEnumerable(false))//no materialization
                {
                    var value = dict[entry.Key];

                    Aver.IsTrue(hs.Add(entry.Key));//ensure no duplication in enumerator

                    Aver.IsNull(entry.Value);
                    Aver.AreEqual(value, tA.Get(entry.Key) as string);
                    cnt++;
                }

                Aver.AreEqual(dict.Count, cnt);//ensure the same# of elements

                hs  = new HashSet <Guid>();
                cnt = 0;
                foreach (var entry in tA.AsEnumerable(true))//with materialization
                {
                    var value = dict[entry.Key];

                    Aver.IsTrue(hs.Add(entry.Key));//ensure no duplication in enumerator

                    Aver.AreEqual(value, entry.Value as string);
                    cnt++;
                }
                Aver.AreEqual(dict.Count, cnt);//ensure the same# of elements

                //------- Manual enumerator -------
                var enumerator = tA.AsEnumerable(false).GetEnumerator();
                cnt = 0;
                hs  = new HashSet <Guid>();
                while (enumerator.MoveNext())
                {
                    var value = dict[enumerator.Current.Key];

                    Aver.IsTrue(hs.Add(enumerator.Current.Key));//ensure no duplication in enumerator

                    Aver.IsNull(enumerator.Current.Value);
                    Aver.AreEqual(value, tA.Get(enumerator.Current.Key) as string);
                    cnt++;
                }

                Aver.AreEqual(dict.Count, cnt);//ensure the same# of elements

                //Reset enumerator
                enumerator.Reset();//<-----------------------------
                cnt = 0;
                hs  = new HashSet <Guid>();
                while (enumerator.MoveNext())
                {
                    var value = dict[enumerator.Current.Key];

                    Aver.IsTrue(hs.Add(enumerator.Current.Key));//ensure no duplication in enumerator

                    Aver.IsNull(enumerator.Current.Value);
                    Aver.AreEqual(value, tA.Get(enumerator.Current.Key) as string);
                    cnt++;
                }

                Aver.AreEqual(dict.Count, cnt);//ensure the same# of elements
            }
        }
Esempio n. 17
0
 public void T130_KeyInt_ManyPutGet(int cnt)
 {
     PileCacheTestCore.KeyInt_ManyPutGet(cnt);
 }
Esempio n. 18
0
 public void T9000000_ParalellGetPutRemove(int workers, int tables, int putCount, int durationSec)
 {
     PileCacheTestCore.ParalellGetPutRemove(workers, tables, putCount, durationSec);
 }
Esempio n. 19
0
 public void T190_FID_PutGetCorrectness(int cnt, int tbls)
 {
     PileCacheTestCore.FID_PutGetCorrectness(cnt, tbls);
 }
Esempio n. 20
0
 public void T140_KeyGDID_ManyPutGet(int cnt)
 {
     PileCacheTestCore.KeyGDID_ManyPutGet(cnt);
 }
Esempio n. 21
0
 public void T150_KeyString_ManyPutGet(int cnt)
 {
     PileCacheTestCore.KeyString_ManyPutGet(cnt);
 }
Esempio n. 22
0
        public void T170_Config()
        {
            var conf1 =
                @"
store
{
        default-table-options
        {
          initial-capacity=1000000
          detailed-instrumentation=true
        }
        
        table
        {
          name='A' 
          minimum-capacity=800000 
          maximum-capacity=987654321 
          initial-capacity=780000
          growth-factor=2.3
          shrink-factor=0.55
          load-factor-lwm=0.1
          load-factor-hwm=0.9
          default-max-age-sec=145
          detailed-instrumentation=true
        }
        
        table
        { 
          name='B' 
          maximum-capacity=256000
          detailed-instrumentation=false
        }
     
}
";
            var c1 = conf1.AsLaconicConfig(handling: ConvertErrorHandling.Throw);

            using (var cache = PileCacheTestCore.MakeCache(c1))
            {
                var tA = cache.GetOrCreateTable <int>("A");

                var topt = cache.DefaultTableOptions;
                Assert.AreEqual(1000000, topt.InitialCapacity);
                Assert.AreEqual(true, topt.DetailedInstrumentation);

                topt = cache.TableOptions["a"];
                Assert.AreEqual(800000, topt.MinimumCapacity);
                Assert.AreEqual(987654321, topt.MaximumCapacity);
                Assert.AreEqual(780000, topt.InitialCapacity);
                Assert.AreEqual(2.3d, topt.GrowthFactor);
                Assert.AreEqual(0.55d, topt.ShrinkFactor);
                Assert.AreEqual(0.1d, topt.LoadFactorLWM);
                Assert.AreEqual(0.9d, topt.LoadFactorHWM);
                Assert.AreEqual(145, topt.DefaultMaxAgeSec);
                Assert.AreEqual(true, topt.DetailedInstrumentation);

                topt = cache.GetOrCreateTable <int>("A").Options;
                Assert.AreEqual(800000, topt.MinimumCapacity);
                Assert.AreEqual(987654321, topt.MaximumCapacity);
                Assert.AreEqual(780000, topt.InitialCapacity);
                Assert.AreEqual(2.3d, topt.GrowthFactor);
                Assert.AreEqual(0.55d, topt.ShrinkFactor);
                Assert.AreEqual(0.1d, topt.LoadFactorLWM);
                Assert.AreEqual(0.9d, topt.LoadFactorHWM);
                Assert.AreEqual(145, topt.DefaultMaxAgeSec);
                Assert.AreEqual(true, topt.DetailedInstrumentation);

                cache.GetOrCreateTable <int>("A").Options.DefaultMaxAgeSec = 197;
                Assert.AreEqual(197, cache.GetOrCreateTable <int>("A").Options.DefaultMaxAgeSec);
                Assert.AreEqual(145, cache.TableOptions["a"].DefaultMaxAgeSec);

                topt = cache.GetOrCreateTable <int>("b").Options;
                Assert.AreEqual(256000, topt.MaximumCapacity);
                Assert.AreEqual(false, topt.DetailedInstrumentation);
            }
        }
Esempio n. 23
0
 public void T160_ResizeTable(int cnt, int rec, int payload)
 {
     PileCacheTestCore.ResizeTable(cnt, rec, payload);
 }