internal virtual void InvalidateReplicatedDataBuffers(SynchronizedBufferPool <BinaryWriter> pool)
        {
            if (pool != null && this.replicatedDataWriter != null)
            {
                pool.Return(this.replicatedDataWriter);
            }

            this.replicatedDataWriter = null;
            this.replicatedData       = new ArraySegment <byte>();
        }
        private MemoryLogicalLog(long startingPos, int maxSizeInMB)
        {
            this.head       = startingPos;
            this.tail       = startingPos;
            this.bytes      = null;
            this.isDisposed = false;

            var chunkSizeKB = ChunkSize / 1024;

            this.maxChuckCount = maxSizeInMB * 1024 / chunkSizeKB;

            this.bufferPool = new SynchronizedBufferPool <ByteArray>(() => new ByteArray(ChunkSize), this.maxChuckCount);
            this.bytes      = new ConcurrentDictionary <long, ByteArray>();
        }
Beispiel #3
0
 internal override void InvalidateReplicatedDataBuffers(SynchronizedBufferPool <BinaryWriter> pool)
 {
     base.InvalidateReplicatedDataBuffers(pool);
     this.replicatedData = new ArraySegment <byte>();
 }
 internal override void InvalidateReplicatedDataBuffers(SynchronizedBufferPool <BinaryWriter> pool)
 {
     base.InvalidateReplicatedDataBuffers(pool);
     this.replicatedData = null;
 }