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

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

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

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