public void TearDown() { if (_bfs != null) { _bfs.Dispose(); _bfs = null; } File.Delete(_bfsFile); }
public Database(DBStructure dbStructure) { _dbStructure = dbStructure; int databaseCacheSize = 0x20000; if (ICore.Instance != null) { databaseCacheSize = Core.SettingStore.ReadInt("Omea", "DatabaseCacheSize", 2048 * 1024); } _bfs = new BlobFileSystem( IOTools.Combine(Path, Name) + ".BlobFileSystem.dbUtil", databaseCacheSize >> 3, 256); _tracer = new Tracer("(DBUtils) Database - " + Name); }
public void AddSingleFile() { const int count = 100000; int handle; BinaryWriter file = _bfs.AllocFile(out handle); Assert.IsTrue(handle > 0); for (int i = 0; i < count; ++i) { file.Write(i.ToString()); } _bfs.Dispose(); _bfs = null; Assert.IsTrue(new FileInfo(_bfsFile).Length > count * 2); }
internal BLOB(Table table, Stream source) { _table = table; _bfs = table.Database.BlobFS; int handle; _bfs.Lock(); try { Stream stream = _bfs.AllocFile(out handle).BaseStream; _id = handle.ToString(); SetStream(source, stream); } finally { _bfs.UnLock(); } }
protected IndexAccessorImpl(string fileName) { isInitializationComplete = false; isErrorFlagRaised = false; _indexFileName = fileName; try { _indexFile = new BlobFileSystem(fileName, OMEnv.CachingStrategy, TEXTINDEX_FS_CLUSTER_SIZE); _indexFile.ManualFlush = true; _indexFile.CurrentFragmentationStrategy = BlobFileSystem.FragmentationStrategy.Exponential; _indexFile.ClusterCacheSize = 2047; } catch (IOException e) { Trace.WriteLine("IndexAccessorImpl (base) ctor: " + e.Message); Trace.WriteLine("IndexAccessorImpl (base): Discarding index..."); Discard(); throw e; } }
public BlobFSMemoryStream(int handle, BlobFileSystem bfs) : base(1024) { _handle = handle; _bfs = bfs; bfs.Lock(); try { CopyStream(this, bfs.GetRawStream(handle), bfs.GetRawBytes()); } catch { SetLength(0); bfs.RewriteFile(handle); bfs.Flush(); } finally { bfs.UnLock(); } base.Position = 0; _dirty = false; }
public void SetUp() { _bfs = new BlobFileSystem(_bfsFile, 0x10000, 32); }
internal BLOB(Table table, string id) { _table = table; _bfs = table.Database.BlobFS; _id = id; }