Exemplo n.º 1
0
        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>();
        }
Exemplo n.º 2
0
        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>();
        }
Exemplo n.º 3
0
 internal override void InvalidateReplicatedDataBuffers(SynchronizedBufferPool <BinaryWriter> pool)
 {
     base.InvalidateReplicatedDataBuffers(pool);
     this.replicatedData = new ArraySegment <byte>();
 }
Exemplo n.º 4
0
 internal override void InvalidateReplicatedDataBuffers(SynchronizedBufferPool <BinaryWriter> pool)
 {
     base.InvalidateReplicatedDataBuffers(pool);
     this.replicatedData = null;
 }