Ejemplo n.º 1
0
        public Buffer(Lmdb.BufferDto dto, string folder)
        {
            _fileName = dto.GetBufferFileName();

            FullPath = Path.Combine(folder, _fileName);

            _startPos = dto.GetBufferStartPos();

            _maxBytes = dto.GetBufferMaxBytes();
            _pos      = dto.GetBufferPos();
            _records  = dto.GetBufferRecords();
        }
Ejemplo n.º 2
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();
        }