public void Put(Span <byte> key, Span <byte> value)
        {
            if (_manifest == null)
            {
                throw new InvalidOperationException("No manifest for database. Did you open it?");
            }
            if (_memCache == null)
            {
                throw new InvalidOperationException("No current memory cache for database. Did you open it?");
            }

            var operation = new BatchOperation()
            {
                Key         = key.ToArray(),
                Data        = value.ToArray(),
                ResultState = ResultState.Exist
            };

            PutInternal(operation);
        }
        private void PutInternal(BatchOperation operation)
        {
            _dbLock.EnterWriteLock();

            try
            {
                MakeSurePutWorks();

                ulong sequenceNumber = _manifest.CurrentVersion.GetNextSequenceNumber();
                var   batch          = new WriteBatch
                {
                    Sequence = sequenceNumber,
                };
                batch.Operations.Add(operation);

                // Write to LOG here.
                _log?.WriteData(batch.EncodeBatch());
                _memCache.Put(batch);
            }
            finally
            {
                _dbLock.ExitWriteLock();
            }
        }