コード例 #1
0
        // mgindex special storage for strings ctor -> no idx file
        //    use SaveData() GetData()
        public KeyStoreHF(string folder, string filename)
        {
            _Path = folder;
            Directory.CreateDirectory(_Path);
            if (_Path.EndsWith(_S) == false)
            {
                _Path += _S;
            }

            _datastore = new StorageFileHF(_Path + filename, Global.HighFrequencyKVDiskBlockSize);
            _datastore.Initialize();
            _BlockSize = _datastore.GetBlockSize();
        }
コード例 #2
0
        public KeyStoreHF(string folder)
        {
            _Path = folder;
            Directory.CreateDirectory(_Path);
            if (_Path.EndsWith(_S) == false)
            {
                _Path += _S;
            }

            if (File.Exists(_Path + _dirtyFilename))
            {
                _log.Error("Last shutdown failed, rebuilding data files...");
                RebuildDataFiles();
            }
            _datastore = new StorageFileHF(_Path + "data.mghf", Global.HighFrequencyKVDiskBlockSize);
            _keys      = new MGIndex <string>(_Path, "keys.idx", 255, /*Global.PageItemCount,*/ false);
            _datastore.Initialize();
            _BlockSize = _datastore.GetBlockSize();
        }