public void CanCreateTransactionBuffersList() { Assert.DoesNotThrow(() => { _buffersList = new TransactionBuffersList(_bufferManager); }); }
public void CanPinNewBuffer() { _buffersList = new TransactionBuffersList(_bufferManager); Assert.DoesNotThrow(() => { _buffersList.PinNew(RandomFilename, new BasePageFormatter()); }); }
public void CannotGetUnusedBuffer() { _buffersList = new TransactionBuffersList(_bufferManager); var block = new Block(RandomFilename, 0); var buffer = _buffersList.GetBuffer(block); Assert.IsNull(buffer); }
public void CanPinBuffer() { _buffersList = new TransactionBuffersList(_bufferManager); _ = _fileManager.Append(RandomFilename, out var block); Assert.DoesNotThrow(() => { _bufferManager.Pin(block); }); }
public void CanPinMultipleTimes() { _buffersList = new TransactionBuffersList(_bufferManager); var block = new Block(RandomFilename, 0); Assert.DoesNotThrow(() => { _buffersList.Pin(block); _buffersList.Pin(block); _buffersList.Pin(block); }); }
public Transaction( ITransactionNumberDispatcher numberDispatcher, IBufferManager bufferManager, IConcurrencyManager concurrencyManager, IFileManager fileManager, ILogManager logManager) { _numberDispatcher = numberDispatcher; _concurrencyManager = concurrencyManager; _fileManager = fileManager; _bufferList = new TransactionBuffersList(bufferManager); _transactionNumber = _numberDispatcher.GetNextTransactionNumber(); _recoveryManager = new RecoveryManager(bufferManager, logManager, _transactionNumber); }