/// <summary>
        /// Initializes a new instance of the <see cref="CacheConfiguration"/> class,
        /// performing a deep copy of specified cache configuration.
        /// </summary>
        /// <param name="other">The other configuration to perfrom deep copy from.</param>
        public CacheConfiguration(CacheConfiguration other)
        {
            if (other != null)
            {
                using (var stream = IgniteManager.Memory.Allocate().GetStream())
                {
                    other.Write(BinaryUtils.Marshaller.StartMarshal(stream));

                    stream.SynchronizeOutput();
                    stream.Seek(0, SeekOrigin.Begin);

                    Read(BinaryUtils.Marshaller.StartUnmarshal(stream));
                }

                CopyLocalProperties(other);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CacheConfiguration"/> class,
        /// performing a deep copy of specified cache configuration.
        /// </summary>
        /// <param name="other">The other configuration to perfrom deep copy from.</param>
        public CacheConfiguration(CacheConfiguration other)
        {
            if (other != null)
            {
                using (var stream = IgniteManager.Memory.Allocate().GetStream())
                {
                    other.Write(BinaryUtils.Marshaller.StartMarshal(stream));

                    stream.SynchronizeOutput();
                    stream.Seek(0, SeekOrigin.Begin);

                    Read(BinaryUtils.Marshaller.StartUnmarshal(stream));
                }

                // Plugins should be copied directly.
                PluginConfigurations = other.PluginConfigurations;
            }
        }