예제 #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);
        }
예제 #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);
        }
예제 #3
0
파일: KeyValueDB.cs 프로젝트: pavolpr/BTDB
        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);
        }
예제 #4
0
파일: KeyValueDB.cs 프로젝트: pavolpr/BTDB
 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);
 }
예제 #5
0
 void SetNewValueFile()
 {
     _cacheValueFile = _fileCollection.AddFile("cav");
     _cacheValueFileId = _cacheValueFile.Index;
     _cacheValueWriter = _cacheValueFile.GetAppenderWriter();
 }
예제 #6
0
 void SetNewValueFile()
 {
     _cacheValueFile   = _fileCollection.AddFile("cav");
     _cacheValueFileId = _cacheValueFile.Index;
     _cacheValueWriter = _cacheValueFile.GetAppenderWriter();
 }
예제 #7
0
 public TrlFileReader(IFileCollectionFile file)
 {
     _readerController = file.GetExclusiveReader();
     _compression      = new SnappyCompressionStrategy();
     _fileId           = file.Index;
 }
예제 #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);
 }
예제 #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);
 }