private void CloseDeleteBuffer()
 {
     if (_deleteBuffer.Position > 0)
     {
         _deleteData.Add(_deleteBuffer.Close());
     }
 }
        public void AddDelete(Byte[] key, Byte[] value)
        {
            if (_deleteBuffer.AddRecord(key))
            {
                if (_deleteBuffer.AddRecord(value))
                {
                    return;
                }

                _deleteBuffer.RemoveRecord(key.Length);
            }

            if (_deleteBuffer.Position == 0)
            {
                int bufferSize = _deleteBuffer.GetBufferSize(key.Length + value.Length);
                var buffer     = new MultipleBuffer(bufferSize);
                buffer.AddRecord(key);
                buffer.AddRecord(value);
                _deleteData.Add(buffer.Close());
            }
            else
            {
                CloseDeleteBuffer();
                AddDelete(key, value);
            }
        }
Esempio n. 3
0
 private void CloseWriteBuffer()
 {
     if (_writeBuffer.Position > 0)
     {
         Byte[] buffer = _writeBuffer.Close();
         _writeData.Add(new Dto.BerkeleyDtoPut(null, buffer));
     }
 }
Esempio n. 4
0
 private void CloseDeleteBuffer()
 {
     if (_deleteBuffer.Position > 0)
     {
         Byte[] buffer = _deleteBuffer.Close();
         _deleteData.Add(buffer);
     }
 }
 private void CloseWriteBuffer()
 {
     if (_writeValueBuffer.Position > 0)
     {
         Byte[] keyBuffer   = _writeKeyBuffer.Close();
         Byte[] valueBuffer = _writeValueBuffer.Close();
         _writeData.Add(new Dto.BerkeleyDtoPut(keyBuffer, valueBuffer));
     }
 }
        public void AddDelete(Byte[] key, Byte[] value)
        {
            if (_deleteBuffer.AddRecord(key))
            {
                if (_deleteBuffer.AddRecord(value))
                    return;

                _deleteBuffer.RemoveRecord(key.Length);
            }

            if (_deleteBuffer.Position == 0)
            {
                int bufferSize = _deleteBuffer.GetBufferSize(key.Length + value.Length);
                var buffer = new MultipleBuffer(bufferSize);
                buffer.AddRecord(key);
                buffer.AddRecord(value);
                _deleteData.Add(buffer.Close());
            }
            else
            {
                CloseDeleteBuffer();
                AddDelete(key, value);
            }
        }