public static IStorageEngine FromFile(string systemFileName, string dataFileName, bool useCompression = false) { var system = new OptimizedFileStream(systemFileName, FileMode.OpenOrCreate); var data = new OptimizedFileStream(dataFileName, FileMode.OpenOrCreate); long initialFreeSize = IOUtils.GetTotalSpace(Path.GetPathRoot(Path.GetFullPath(dataFileName))); return(STSdb.FromStream(system, data, initialFreeSize, useCompression)); }
public static IStorageEngine FromMemory(bool useCompression = false) { var system = new MemoryStream(); var data = new MemoryStream(); long initialFreeSize = 0; ManagementObjectSearcher searcher = new ManagementObjectSearcher(new ObjectQuery("SELECT * From Win32_ComputerSystem")); foreach (var item in searcher.Get()) { initialFreeSize = long.Parse(item["TotalPhysicalMemory"].ToString()); } return(STSdb.FromStream(system, data, initialFreeSize, useCompression)); }
public static IStorageEngine FromFile(string fileName, bool useCompression = false, AllocationStrategy strategy = AllocationStrategy.FromTheCurrentBlock) { var stream = new OptimizedFileStream(fileName, FileMode.OpenOrCreate); return(STSdb.FromStream(stream, useCompression, strategy)); }
public static IStorageEngine FromMemory(bool useCompression = false, AllocationStrategy strategy = AllocationStrategy.FromTheCurrentBlock) { var stream = new MemoryStream(); return(STSdb.FromStream(stream, useCompression, strategy)); }
public static IStorageEngine FromFile(string fileName) { var stream = new OptimizedFileStream(fileName, FileMode.OpenOrCreate); return(STSdb.FromStream(stream)); }