void StartNewPureValueFile() { _pureValueFile = _fileCollection.AddFile("hpv"); _pureValueFileWriter = _pureValueFile.GetAppenderWriter(); var fileInfo = new FilePureValuesWithId(_subDBId, _fileCollection.NextGeneration(), _fileCollection.Guid); fileInfo.WriteHeader(_pureValueFileWriter); _fileCollection.SetInfo(_pureValueFile.Index, fileInfo); }
void StartNewHashIndexFile() { _hashIndexFile = _fileCollection.AddFile("hid"); _hashIndexWriter = _hashIndexFile.GetAppenderWriter(); var fileInfo = new HashKeyIndex(_subDBId, _fileCollection.NextGeneration(), _fileCollection.Guid, (uint)_keyLen); fileInfo.WriteHeader(_hashIndexWriter); _fileCollection.SetInfo(_hashIndexFile.Index, fileInfo); }
void WriteStartOfNewTransactionLogFile() { if (_writerWithTransactionLog != null) { _writerWithTransactionLog.WriteUInt8((byte)KVCommandType.EndOfFile); _writerWithTransactionLog.FlushBuffer(); _fileWithTransactionLog.HardFlush(); _fileWithTransactionLog.Truncate(); _fileIdWithPreviousTransactionLog = _fileIdWithTransactionLog; } _fileWithTransactionLog = FileCollection.AddFile("trl"); _fileIdWithTransactionLog = _fileWithTransactionLog.Index; var transactionLog = new FileTransactionLog(FileCollection.NextGeneration(), FileCollection.Guid, _fileIdWithPreviousTransactionLog); _writerWithTransactionLog = _fileWithTransactionLog.GetAppenderWriter(); transactionLog.WriteHeader(_writerWithTransactionLog); FileCollection.SetInfo(_fileIdWithTransactionLog, transactionLog); }
internal void WriteStartTransaction() { if (_fileIdWithTransactionLog == 0) { WriteStartOfNewTransactionLogFile(); } else { if (_writerWithTransactionLog == null) { _fileWithTransactionLog = FileCollection.GetFile(_fileIdWithTransactionLog); _writerWithTransactionLog = _fileWithTransactionLog.GetAppenderWriter(); } if (_writerWithTransactionLog.GetCurrentPosition() > MaxTrLogFileSize) { WriteStartOfNewTransactionLogFile(); } } _writerWithTransactionLog.WriteUInt8((byte)KVCommandType.TransactionStart); _writerWithTransactionLog.WriteByteArrayRaw(MagicStartOfTransaction); }
void SetNewValueFile() { _cacheValueFile = _fileCollection.AddFile("cav"); _cacheValueFileId = _cacheValueFile.Index; _cacheValueWriter = _cacheValueFile.GetAppenderWriter(); }
public TrlFileReader(IFileCollectionFile file) { _readerController = file.GetExclusiveReader(); _compression = new SnappyCompressionStrategy(); _fileId = file.Index; }
void StartNewHashIndexFile() { _hashIndexFile = _fileCollection.AddFile("hid"); _hashIndexWriter = _hashIndexFile.GetAppenderWriter(); var fileInfo = new HashKeyIndex(_subDBId, _fileCollection.NextGeneration(), (uint)_keyLen); fileInfo.WriteHeader(_hashIndexWriter); _fileCollection.SetInfo(_hashIndexFile.Index, fileInfo); }
void StartNewPureValueFile() { _pureValueFile = _fileCollection.AddFile("hpv"); _pureValueFileWriter = _pureValueFile.GetAppenderWriter(); var fileInfo = new FilePureValuesWithId(_subDBId, _fileCollection.NextGeneration()); fileInfo.WriteHeader(_pureValueFileWriter); _fileCollection.SetInfo(_pureValueFile.Index, fileInfo); }