Esempio n. 1
0
        public static async Task BasicOperations(IOdin clive)
        {
            await clive.Put("foo", "bar");
            Assert.AreEqual("bar", await clive.Get("foo"));
            await clive.Put("foo", "baz");
            Assert.AreEqual("baz", await clive.Get("foo"));
            await clive.Delete("foo");
            Assert.AreEqual(null, await clive.Get("foo"));
            await clive.Delete("foo");

            var tasks = new List<Task>();
            for (var i = 0; i < 100; i++)
            {
                tasks.Add(clive.Put(i.ToString().PadLeft(4, '0'), i.ToString()));
            }
            await Task.WhenAll(tasks);
            tasks.Clear();

            var items = (await clive.Search()).ToArray();
            Assert.AreEqual(100, items.Length);
            Assert.AreEqual("0000", items[0].Key);
            Assert.AreEqual("0099", items[99].Key);

            items = (await clive.Search(start: "0001", end: "0010")).ToArray();
            Assert.AreEqual(10, items.Length);
            Assert.AreEqual("0001", items[0].Key);
            Assert.AreEqual("0010", items[9].Key);

            for (var i = 0; i < 100; i++)
            {
                tasks.Add(clive.Delete(i.ToString()));
            }
        }
Esempio n. 2
0
 public OdinTracer(IOdin target, bool traceGet = true, bool tracePut = true, bool traceDelete = true, bool traceSearch = true)
 {
     this.traceGet = traceGet;
     this.tracePut = tracePut;
     this.traceDelete = traceDelete;
     this.traceSearch = traceSearch;
     this.Target = target;
 }
Esempio n. 3
0
 public OdinTracer(IOdin target, bool traceGet = true, bool tracePut = true, bool traceDelete = true, bool traceSearch = true)
 {
     this.traceGet    = traceGet;
     this.tracePut    = tracePut;
     this.traceDelete = traceDelete;
     this.traceSearch = traceSearch;
     this.Target      = target;
 }
Esempio n. 4
0
        public static async Task BasicOperations(IOdin clive)
        {
            await clive.Put("foo", "bar");

            Assert.AreEqual("bar", await clive.Get("foo"));
            await clive.Put("foo", "baz");

            Assert.AreEqual("baz", await clive.Get("foo"));
            await clive.Delete("foo");

            Assert.AreEqual(null, await clive.Get("foo"));
            await clive.Delete("foo");

            var tasks = new List <Task>();

            for (var i = 0; i < 100; i++)
            {
                tasks.Add(clive.Put(i.ToString().PadLeft(4, '0'), i.ToString()));
            }
            await Task.WhenAll(tasks);

            tasks.Clear();

            var items = (await clive.Search()).ToArray();

            Assert.AreEqual(100, items.Length);
            Assert.AreEqual("0000", items[0].Key);
            Assert.AreEqual("0099", items[99].Key);

            items = (await clive.Search(start: "0001", end: "0010")).ToArray();
            Assert.AreEqual(10, items.Length);
            Assert.AreEqual("0001", items[0].Key);
            Assert.AreEqual("0010", items[9].Key);

            for (var i = 0; i < 100; i++)
            {
                tasks.Add(clive.Delete(i.ToString()));
            }
        }
Esempio n. 5
0
 public FanOut(IOdin[] reads, IOdin[] writes)
 {
     this.Reads = reads;
     this.Writes = writes;
 }
Esempio n. 6
0
 public Retry(IOdin target, int retryTime = 100, int retryCount = 5)
 {
     this.Target     = target;
     this.RetryTime  = retryTime;
     this.RetryCount = retryCount;
 }
Esempio n. 7
0
 public OdinJsonSerializer(IOdin odin)
 {
     this.Odin = odin;
 }
Esempio n. 8
0
 public Counter(IOdin target)
 {
     this.Target = target;
 }
Esempio n. 9
0
 public Retry(IOdin target, int retryTime = 100, int retryCount = 5)
 {
     this.Target = target;
     this.RetryTime = retryTime;
     this.RetryCount = retryCount;
 }
Esempio n. 10
0
 public OdinVersioner(IOdin target)
 {
     this.Target = target;
     this.master = new Partition(target, "__MASTER_KEYS");
 }
Esempio n. 11
0
 public Counter(IOdin target)
 {
     this.Target = target;
 }
Esempio n. 12
0
 public Partition(IOdin odin, string partition, char seperator = (char)255)
 {
     this.odin          = odin;
     this.PartitionName = partition;
     this.Seperator     = "" + seperator;
 }
Esempio n. 13
0
 public OdinGeoSpatial(IOdin odin)
 {
     this.GeoIndex = new OdinJsonSerializer<PositionKeyValue>(new Partition(odin, "GI"));
     this.KeyIndex = new Partition(odin, "KI");
 }
Esempio n. 14
0
 public OdinVersioner(IOdin target)
 {
     this.Target = target;
     this.master = new Partition(target, "__MASTER_KEYS");
 }
Esempio n. 15
0
 public OdinTriplestore(IOdin odin)
 {
     this.Store = new OdinJsonSerializer<Triple>(odin);
     this.KeyEncoder = MD5Hash;
 }
Esempio n. 16
0
 public OdinCache(IOdin store, TimeSpan duration)
 {
     this.Store = store;
     this.Cache = new MemoryCache("odin");
 }
Esempio n. 17
0
 public OdinTriplestore(IOdin odin)
 {
     this.Store      = new OdinJsonSerializer <Triple>(odin);
     this.KeyEncoder = MD5Hash;
 }
Esempio n. 18
0
 public Partition(IOdin odin, string partition, char seperator = (char)255)
 {
     this.odin = odin;
     this.PartitionName = partition;
     this.Seperator = "" + seperator;
 }
Esempio n. 19
0
 public OdinCache(IOdin store, TimeSpan duration)
 {
     this.Store = store;
     this.Cache = new MemoryCache("odin");
 }
Esempio n. 20
0
 public OdinGeoSpatial(IOdin odin)
 {
     this.GeoIndex = new OdinJsonSerializer <PositionKeyValue>(new Partition(odin, "GI"));
     this.KeyIndex = new Partition(odin, "KI");
 }