Esempio n. 1
0
 private bool dUpdate(byte[] key, BSonDoc doc)
 {
     lock (_primarystore)
     foreach (var d in _primarystore)
       if (d.ContainsKey(key))
       {
     d[key] = doc.Serialize();
     return true;
       }
       return false;
 }
Esempio n. 2
0
        private void dInsert(byte[] key, BSonDoc doc)
        {
            //doc["@ts#"

              Dictionary<byte[], byte[]> freedictionary = null;
              foreach (var d in _primarystore)
            if (d.Count < Configuration.DictionarySplitSize)
            {
              freedictionary = d; break;
            }

              if (freedictionary == null)
              {
            freedictionary = new Dictionary<byte[], byte[]>();
            _primarystore.Add(freedictionary);
              }

              if (!freedictionary.ContainsKey(key))
            freedictionary.Add(key, doc.Serialize());
        }