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));
                    }
            }
        }
        public MultiProcessTests(SharedFileSystem fileSystem)
        {
            var path = fileSystem.CreateNewDirectoryForTest();

            _env = new LightningEnvironment(path);
            _env.Open();
        }
        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();
 }
        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;
 }