public void AddInHead(Node dataNode, bool addInCache) { if (!addInCache && GeneratePruneEvent && DataDriver != null) { if (MaxCapacity > 0 && Count >= MaxCapacity) { if (RemovedObjects.Count == 0) { Log.Logger.Instance.Log(Log.LogLevels.Information, "InternalMruManager.AddInHead: pruning enter."); //RemovedObjects.Clear(); for (int i = MaxCapacity; i > MinCapacity; i--) { this.RemoveInTail(true); } Log.Logger.Instance.Log(Log.LogLevels.Information, "InternalMruManager.AddInHead: pruning exit."); RemovedObjects.Clear(); } } } Node n = dataNode; n.Next = _head; n.Previous = null; if (_head != null) { _head.Previous = n; } else { _tail = n; } _head = n; Count++; }
public void SaveRemovedBlocks() { if (RemovedObjects.Count <= 0) { return; } bool WasSaved = false; if (Collection != null) { if ((SaveState & Sop.Mru.SaveTypes.DataPoolInMaxCapacity) != Sop.Mru.SaveTypes.DataPoolInMaxCapacity) { Log.Logger.Instance.Log(Log.LogLevels.Information, "GenericInternalMruManager.SaveRemoveBlocks: OnMaxCapacity(RemovedObjects.Values) enter."); SaveState |= Sop.Mru.SaveTypes.DataPoolInMaxCapacity; WasSaved = ((IMruClient)Collection).OnMaxCapacity(RemovedObjects.Values) > 0; SaveState ^= Sop.Mru.SaveTypes.DataPoolInMaxCapacity; if (WasSaved) { RemovedObjects.Clear(); } Log.Logger.Instance.Log(Log.LogLevels.Information, "GenericInternalMruManager.SaveRemoveBlocks: OnMaxCapacity(RemovedObjects.Values) exit."); } return; } RemovedObjects.Clear(); }
private void filtersToolStripMenuItem_Click(object sender, EventArgs e) { GenericArrayList <UserFilterObject> RemovedObjects; TabPage CurrTab; frmFilters FiltersDlg = new frmFilters(UserFilters); FiltersDlg.ShowDialog(); RemovedObjects = FiltersDlg.GetRemovedObjects(); if (RemovedObjects.Count > 0) { //perform real deleting operation foreach (UserFilterObject filter in RemovedObjects) { logcat.RemoveSlot(filter.Name); for (int i = 0; i < tbFilterContainer.TabPages.Count; i++) { CurrTab = tbFilterContainer.TabPages[i]; if (CurrTab.Text == filter.Name) { tbFilterContainer.TabPages.Remove(CurrTab); CurrTab.Dispose(); } } } RemovedObjects.Clear(); UserFilterObject.SaveFilters(UserFilters, "filter.flt"); } }
/* * /// <summary> * /// Based on MaxMemoryUsage vs. current usage, this function will generate OnMaxCapacity event * /// to cause associated CollectionOnDisk (DataStore) to offload objects onto Disk. * /// </summary> * protected void MonitorMemory() * { * System.Diagnostics.Process p = System.Diagnostics.Process.GetCurrentProcess(); * long MemoryUsage = p.WorkingSet64; * IntPtr MaxMemoryUsage = p.MaxWorkingSet; * } */ /// <summary> /// Save Removed Blocks to target store /// </summary> public void SaveRemovedBlocks() { mruManager.SaveRemovedBlocks(); Recycle(RemovedObjects.Values); RemovedObjects.Clear(); }