コード例 #1
0
ファイル: TMSNStoreWriter.cs プロジェクト: zbxzc35/BoostTree
        public KeyIndex(string filename, long keysFileLength, bool mmapFile)
        {
            _keyIndexReader = new BinaryFileReader(filename, mmapFile);
            long filelength = _keyIndexReader.BaseStream.Length;

            _keyIndexReader.Seek(-12, SeekOrigin.End);
            _numRecords = _keyIndexReader.ReadInt64();

            _keyGroupSize = _keyIndexReader.ReadUInt32();
            _numKeyGroups = _CalcNumKeyGroups(_numRecords, _keyGroupSize);

            _keysFileLength = keysFileLength;
        }
コード例 #2
0
ファイル: TMSNStoreReader.cs プロジェクト: zbxzc35/BoostTree
        public KeyCacheReader(string dbdir, uint keyGroupSize, bool mmapFiles)
        {
            _keyGroupSize = keyGroupSize;

            #if NAMEDPIPEMODE
            string file = dbdir + ":cache-index";
            _cacheIndexReader = new BinaryFileReader(file, mmapFiles);

            file = dbdir + ":cache";
            _cacheReader = new BinaryFileReader(file, mmapFiles);

            _bytesPerIndex = TMSNStoreUtils.BytesPerKeyIndexOffset;

            #else
            string file = Path.Combine(dbdir, "cache-index");
            _cacheIndexReader = new BinaryFileReader(file, mmapFiles);

            file = Path.Combine(dbdir, "cache");
            _cacheReader = new BinaryFileReader(file, mmapFiles);
            _bytesPerIndex = TMSNStoreUtils.BytesPerKeyIndexOffset;
            #endif
        }