示例#1
0
            public void CanPinBufferWriteAndFlush()
            {
                _poolStrategy = new LRUBufferPoolStrategy(_logManager, _fileManager, 3);

                var filename      = RandomFilename;
                var pageFormatter = new BasePageFormatter();

                var buffer1 = _poolStrategy.PinNew(filename, pageFormatter);

                buffer1.SetInt(0, 123, 1, 1);
                _poolStrategy.FlushAll(1);
                _poolStrategy.Unpin(buffer1);

                var page    = _fileManager.ResolvePage();
                var canRead = page.Read(new Block(filename, 0));

                var canGetValue = page.GetInt(0, out var value);

                Assert.IsFalse(buffer1.IsPinned);
                Assert.IsTrue(canRead);
                Assert.IsTrue(canGetValue);
                Assert.AreEqual(123, value);
            }
示例#2
0
 public void FlushAll(int transactionNumber)
 {
     _poolStrategy.FlushAll(transactionNumber);
 }