/// <nodoc />
        public TransitioningContentLocationStore(
            RedisContentLocationStoreConfiguration configuration,
            RedisContentLocationStore redisContentLocationStore,
            LocalLocationStore localLocationStore)
        {
            Contract.Requires(configuration != null);

            _configuration             = configuration;
            _localLocationStore        = localLocationStore;
            _redisContentLocationStore = redisContentLocationStore;

            Contract.Assert(!_configuration.HasReadOrWriteMode(ContentLocationMode.Redis) || _redisContentLocationStore != null);
            Contract.Assert(!_configuration.HasReadOrWriteMode(ContentLocationMode.LocalLocationStore) || _localLocationStore != null);
        }
Example #2
0
        /// <inheritdoc />
        public CounterSet GetCounters(Context context)
        {
            var counters = new CounterSet();

            if (_configuration.HasReadOrWriteMode(ContentLocationMode.Redis))
            {
                counters.Merge(_redisContentLocationStore.GetCounters(context));
            }

            if (_configuration.HasReadOrWriteMode(ContentLocationMode.LocalLocationStore))
            {
                counters.Merge(_localLocationStore.GetCounters(context), "LLS.");
            }

            return(counters);
        }