Example #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private synchronized SegmentFile createNext(long prevFileLastIndex, long prevIndex, long prevTerm) throws java.io.IOException
        private SegmentFile CreateNext(long prevFileLastIndex, long prevIndex, long prevTerm)
        {
            lock (this)
            {
                _currentVersion++;
                SegmentHeader header = new SegmentHeader(prevFileLastIndex, _currentVersion, prevIndex, prevTerm);

                File        file    = _fileNames.getForVersion(_currentVersion);
                SegmentFile segment = SegmentFile.Create(_fileSystem, file, _readerPool, _currentVersion, _contentMarshal, _logProvider, header);
                // TODO: Force base directory... probably not possible using fsa.
                segment.Flush();

                _allSegments.Add(segment);
                _rangeMap.replaceFrom(prevIndex + 1, segment);

                return(segment);
            }
        }