Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
        }
Exemple #4
0
 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);
 }
Exemple #5
0
 void SetNewValueFile()
 {
     _cacheValueFile = _fileCollection.AddFile("cav");
     _cacheValueFileId = _cacheValueFile.Index;
     _cacheValueWriter = _cacheValueFile.GetAppenderWriter();
 }
Exemple #6
0
 void SetNewValueFile()
 {
     _cacheValueFile   = _fileCollection.AddFile("cav");
     _cacheValueFileId = _cacheValueFile.Index;
     _cacheValueWriter = _cacheValueFile.GetAppenderWriter();
 }
Exemple #7
0
 public TrlFileReader(IFileCollectionFile file)
 {
     _readerController = file.GetExclusiveReader();
     _compression      = new SnappyCompressionStrategy();
     _fileId           = file.Index;
 }
Exemple #8
0
 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);
 }
Exemple #9
0
 void StartNewPureValueFile()
 {
     _pureValueFile = _fileCollection.AddFile("hpv");
     _pureValueFileWriter = _pureValueFile.GetAppenderWriter();
     var fileInfo = new FilePureValuesWithId(_subDBId, _fileCollection.NextGeneration());
     fileInfo.WriteHeader(_pureValueFileWriter);
     _fileCollection.SetInfo(_pureValueFile.Index, fileInfo);
 }