Exemplo n.º 1
0
        public DistributedContentStoreFactory(DistributedCacheServiceArguments arguments)
        {
            _logger              = arguments.Logger;
            _arguments           = arguments;
            _distributedSettings = arguments.Configuration.DistributedContentSettings;
            _keySpace            = string.IsNullOrWhiteSpace(_arguments.Keyspace) ? ContentLocationStoreFactory.DefaultKeySpace : _arguments.Keyspace;
            _fileSystem          = arguments.FileSystem;
            _secretRetriever     = new DistributedCacheSecretRetriever(arguments);

            _orderedResolvedCacheSettings = ResolveCacheSettingsInPrecedenceOrder(arguments);
            Contract.Assert(_orderedResolvedCacheSettings.Count != 0);

            RedisContentLocationStoreConfiguration = CreateRedisConfiguration();
            _distributedContentStoreSettings       = CreateDistributedStoreSettings(_arguments, RedisContentLocationStoreConfiguration);

            _copier = new DistributedContentCopier(
                _distributedContentStoreSettings,
                _fileSystem,
                fileCopier: _arguments.Copier,
                copyRequester: _arguments.CopyRequester,
                _arguments.Overrides.Clock,
                _logger
                );

            _redisMemoizationStoreFactory = new Lazy <RedisMemoizationStoreFactory>(() => CreateRedisCacheFactory());
        }
        public DistributedContentStoreFactory(DistributedCacheServiceArguments arguments)
        {
            _logger              = arguments.Logger;
            _arguments           = arguments;
            _distributedSettings = arguments.Configuration.DistributedContentSettings;
            _keySpace            = string.IsNullOrWhiteSpace(_arguments.Keyspace) ? ContentLocationStoreFactory.DefaultKeySpace : _arguments.Keyspace;
            _fileSystem          = new PassThroughFileSystem(_logger);
            _secretRetriever     = new DistributedCacheSecretRetriever(arguments);
            var bandwidthCheckedCopier = new BandwidthCheckedCopier(_arguments.Copier, BandwidthChecker.Configuration.FromDistributedContentSettings(_distributedSettings));

            _orderedResolvedCacheSettings = ResolveCacheSettingsInPrecedenceOrder(arguments);
            Contract.Assert(_orderedResolvedCacheSettings.Count != 0);

            RedisContentLocationStoreConfiguration = CreateRedisConfiguration();
            _distributedContentStoreSettings       = CreateDistributedStoreSettings(_arguments, RedisContentLocationStoreConfiguration);

            _copier = new DistributedContentCopier <AbsolutePath>(
                _distributedContentStoreSettings,
                _fileSystem,
                fileCopier: bandwidthCheckedCopier,
                fileExistenceChecker: _arguments.Copier,
                _arguments.CopyRequester,
                _arguments.PathTransformer,
                _arguments.Overrides.Clock
                );

            _redisMemoizationStoreFactory = new Lazy <RedisMemoizationStoreFactory>(() => CreateRedisCacheFactory());
        }
 public DistributedContentStoreFactory(DistributedCacheServiceArguments arguments)
 {
     _logger    = arguments.Logger;
     _arguments = arguments;
     _redisContentSecretNames = arguments.Configuration.DistributedContentSettings.GetRedisConnectionSecretNames(arguments.HostInfo.StampId);
     _distributedSettings     = arguments.Configuration.DistributedContentSettings;
     _keySpace        = string.IsNullOrWhiteSpace(_arguments.Keyspace) ? RedisContentLocationStoreFactory.DefaultKeySpace : _arguments.Keyspace;
     _fileSystem      = new PassThroughFileSystem(_logger);
     _secretRetriever = new DistributedCacheSecretRetriever(arguments);
 }