示例#1
0
        void LoadData()
        {
            if (!Directory.Exists(_folder))
            {
                return;
            }



            using (var env = LmdbEnv.CreateDb(_folder, 1024 * 1024, EnvironmentOpenFlags.ReadOnly)) {
                using (var tx = env.Read()) {
                    _chunks  = Lmdb.ListChunks(tx).Select(c => c.Value).ToArray();
                    _buffer  = Lmdb.GetBuffer(tx, 0);
                    _cellar  = Lmdb.GetCellarMeta(tx, 0, new Lmdb.CellarDto());
                    ByteSize = Cellar.EstimateSize(tx).ByteSize;
                }
            }

            _maxKeySize   = _cellar.GetCellarMaxKeySize();
            _maxValueSize = _cellar.GetCellarMaxValSize();
        }
示例#2
0
 public CellarSize EstimateSize()
 {
     using (var tx = _env.Read()) {
         return(Cellar.EstimateSize(tx));
     }
 }