public TransactionTests(SharedFileSystem fileSystem)
        {
            var path = fileSystem.CreateNewDirectoryForTest();

            _env = new LightningEnvironment(path);
            _env.Open();
        }
Пример #2
0
        public void DatabaseDeleteShouldRemoveAllDuplicateDataItems()
        {
            var fs = new SharedFileSystem();

            using (var env = new LightningEnvironment(fs.CreateNewDirectoryForTest(), configuration: new EnvironmentConfiguration {
                MapSize = 1024 * 1024, MaxDatabases = 1
            }))
            {
                env.Open();
                using (var tx = env.BeginTransaction())
                    using (var db = tx.OpenDatabase(configuration: new DatabaseConfiguration()
                    {
                        Flags = DatabaseOpenFlags.DuplicatesSort
                    }))
                    {
                        var key    = "key";
                        var value1 = "value1";
                        var value2 = "value2";

                        tx.Put(db, key, value1);
                        tx.Put(db, key, value2);

                        tx.Delete(db, key);
                        Assert.False(tx.ContainsKey(db, key));
                    }
            }
        }
Пример #3
0
        public MultiProcessTests(SharedFileSystem fileSystem)
        {
            var path = fileSystem.CreateNewDirectoryForTest();

            _env = new LightningEnvironment(path);
            _env.Open();
        }
Пример #4
0
        public FinalizeTests(SharedFileSystem fileSystem)
        {
            var env = new LightningEnvironment(fileSystem.CreateNewDirectoryForTest());

            env.Open();
            var tx = env.BeginTransaction();
            var db = tx.OpenDatabase();

            tx.CreateCursor(db);
        }
Пример #5
0
        public DatabaseIOTests(SharedFileSystem fileSystem)
        {
            var path = fileSystem.CreateNewDirectoryForTest();

            _env = new LightningEnvironment(path);
            _env.MaxDatabases = 2;
            _env.Open();

            _txn = _env.BeginTransaction();
            _db  = _txn.OpenDatabase(configuration: new DatabaseConfiguration {
                Flags = DatabaseOpenFlags.Create
            });
        }
Пример #6
0
 public EnvironmentTests(SharedFileSystem fileSystem)
 {
     _path     = fileSystem.CreateNewDirectoryForTest();
     _pathCopy = fileSystem.CreateNewDirectoryForTest();
 }
Пример #7
0
        public DatabaseTests(SharedFileSystem fileSystem)
        {
            var path = fileSystem.CreateNewDirectoryForTest();

            _env = new LightningEnvironment(path);
        }
Пример #8
0
 public ProfilingTests(SharedFileSystem fileSystem)
 {
     _env = new LightningEnvironment(fileSystem.CreateNewDirectoryForTest());
     _env.MaxDatabases = 2;
     _env.Open();
 }
Пример #9
0
 public MultiProcessTests(SharedFileSystem fileSystem)
 {
     _fileSystem = fileSystem;
 }