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. 2
0
 public BerkeleyBulkCursor(BerkeleyDb berkeleyDb, int bufferSize) :
     base(berkeleyDb, bufferSize, BerkeleyDbMultiple.DB_MULTIPLE_KEY)
 {
     _deleteBuffer = new MultipleBuffer(bufferSize);
     _deleteData   = new List <Byte[]>();
     _writeBuffer  = new MultipleBuffer(bufferSize);
     _writeData    = new List <Dto.BerkeleyDtoPut>();
 }
 public BerkeleyBulkCursor(BerkeleyDb berkeleyDb, int bufferSize) :
     base(berkeleyDb, bufferSize, BerkeleyDbMultiple.DB_MULTIPLE_KEY)
 {
     _deleteBuffer = new MultipleBuffer(bufferSize);
     _deleteData = new List<Byte[]>();
     _writeBuffer = new MultipleBuffer(bufferSize);
     _writeData = new List<Dto.BerkeleyDtoPut>();
 }
        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. 5
0
 protected override void SetDtoGet(ref Dto.BerkeleyDtoGet dataGet)
 {
     _readBuffer = new MultipleBuffer(dataGet.Value);
 }
 protected override void SetDtoGet(ref Dto.BerkeleyDtoGet dataGet)
 {
     _readKey = dataGet.Key;
     _readValueBuffer = new MultipleBuffer(dataGet.Value);
 }