Exemple #1
0
        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));
        }
Exemple #2
0
        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));
        }
Exemple #3
0
        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));
        }
Exemple #4
0
        public static IStorageEngine FromMemory(bool useCompression = false, AllocationStrategy strategy = AllocationStrategy.FromTheCurrentBlock)
        {
            var stream = new MemoryStream();

            return(STSdb.FromStream(stream, useCompression, strategy));
        }
Exemple #5
0
        public static IStorageEngine FromFile(string fileName)
        {
            var stream = new OptimizedFileStream(fileName, FileMode.OpenOrCreate);

            return(STSdb.FromStream(stream));
        }