Esempio n. 1
0
        /// <summary>
        /// Creates a new <see cref="LocalSnapshotStore"/> instance.
        /// </summary>
        public LocalSnapshotStore()
        {
            var config = Context.System.Settings.Config.GetConfig("akka.persistence.snapshot-store.local");

            _maxLoadAttempts = config.GetInt("max-load-attempts");

            _streamDispatcher = Context.System.Dispatchers.Lookup(config.GetString("stream-dispatcher"));
            _dir = new DirectoryInfo(config.GetString("dir"));

            _defaultSerializer = config.GetString("serializer");

            _serialization     = Context.System.Serialization;
            _wrapperSerializer = _serialization.FindSerializerForType(WrapperType);
            _saving            = new SortedSet <SnapshotMetadata>(SnapshotMetadata.Comparer); // saving in progress
            _log = Context.GetLogger();
        }
Esempio n. 2
0
        /// <summary>
        /// Creates a new <see cref="LocalSnapshotStore"/> instance.
        /// </summary>
        public LocalSnapshotStore()
        {
            var config = Context.System.Settings.Config.GetConfig("akka.persistence.snapshot-store.local");

            /*
             * if (config.IsNullOrEmpty())
             *  throw new ConfigurationException($"Cannot create {typeof(LocalSnapshotStore)}: akka.persistence.snapshot-store.local configuration node not found");
             */

            _maxLoadAttempts = config.GetInt("max-load-attempts", 0);

            _streamDispatcher = Context.System.Dispatchers.Lookup(config.GetString("stream-dispatcher", null));
            _dir = new DirectoryInfo(config.GetString("dir", null));

            _defaultSerializer = config.GetString("serializer", null);

            _serialization     = Context.System.Serialization;
            _wrapperSerializer = _serialization.FindSerializerForType(WrapperType);
            _saving            = new SortedSet <SnapshotMetadata>(SnapshotMetadata.Comparer); // saving in progress
            _log = Context.GetLogger();
        }