protected internal virtual int SaveBlocks(ICollectionOnDisk parent, int maxBlocks, bool clear) { int r = 0; if (parent != null) { if (!_inSaveBlocks && !DelaySaveBlocks) { _inSaveBlocks = true; r = Blocks.Count; if (Blocks.Count >= maxBlocks) { WriteBlocksToDisk(parent, Blocks, clear); if (DataBlockDriver.BlockRecycler == null) { ((DataBlockDriver)DataBlockDriver).BlockRecycler = new DataBlockRecycler(File.Profile.MaxInMemoryBlockCount); ((DataBlockRecycler)((DataBlockDriver)DataBlockDriver).BlockRecycler).PreAllocateBlocks(DataBlockSize); } DataBlockDriver.BlockRecycler.Recycle(Blocks.Values); Blocks.Clear(); } _inSaveBlocks = false; } } return(r); }
internal static RecordKey CreateKey(ICollectionOnDisk collection, long address) { var key = new RecordKey(); key.ServerSystemFilename = collection.File.Server.Filename; key.Filename = collection.File.Filename; key.CollectionName = collection.Name; key.Address = address; return(key); }
private bool SystemManagedStore(ICollectionOnDisk store) { return(store == ((FileSet)Server.FileSet).Btree || store == _store || store == ((FileRecycler)DeletedCollections).Collection); }
internal static RecordKey CreateKey(ICollectionOnDisk collection) { return(CreateKey(collection, -1)); }
protected virtual void WriteBlocksToDisk(ICollectionOnDisk parent, IDictionary <long, Sop.DataBlock> blocks, bool clear) { DataBlockDriver.WriteBlocksToDisk(parent, blocks, clear); }
protected int SaveBlocks(ICollectionOnDisk parent, bool clear) { return(SaveBlocks(parent, 1, clear)); }