Beispiel #1
0
        internal DistributedCacheServiceArguments CreateDistributedCacheServiceArguments(
            IAbsolutePathFileCopier copier,
            IAbsolutePathTransformer pathTransformer,
            DistributedContentSettings dcs,
            HostInfo host,
            string cacheName,
            string cacheRootPath,
            uint grpcPort,
            int maxSizeQuotaMB,
            string dataRootPath,
            CancellationToken ct,
            int?bufferSizeForGrpcCopies      = null,
            int?gzipBarrierSizeForGrpcCopies = null)
        {
            var distributedCacheServiceHost = new EnvironmentVariableHost();

            var localCasSettings = LocalCasSettings.Default(
                maxSizeQuotaMB: maxSizeQuotaMB,
                cacheRootPath: cacheRootPath,
                cacheName: cacheName,
                grpcPort: grpcPort,
                grpcPortFileName: _scenario);

            localCasSettings.PreferredCacheDrive = Path.GetPathRoot(cacheRootPath);
            localCasSettings.ServiceSettings     = new LocalCasServiceSettings(60, scenarioName: _scenario, grpcPort: grpcPort, grpcPortFileName: _scenario, bufferSizeForGrpcCopies: bufferSizeForGrpcCopies, gzipBarrierSizeForGrpcCopies: gzipBarrierSizeForGrpcCopies);

            var config = new DistributedCacheServiceConfiguration(localCasSettings, dcs);

            return(new DistributedCacheServiceArguments(_logger, copier, pathTransformer, distributedCacheServiceHost, host, ct, dataRootPath, config, null));
        }
Beispiel #2
0
        internal DistributedCacheServiceArguments CreateDistributedCacheServiceArguments(
            IAbsolutePathFileCopier copier, IAbsolutePathTransformer pathTransformer, HostInfo host, string cacheName, string cacheRootPath, uint grpcPort, int maxSizeQuotaMB, string dataRootPath, CancellationToken ct, int?bufferSizeForGrpcCopies = null)
        {
            var distributedCacheServiceHost = new TestHost();

            var localCasSettings = LocalCasSettings.Default(
                maxSizeQuotaMB: maxSizeQuotaMB,
                cacheRootPath: cacheRootPath,
                cacheName: cacheName,
                grpcPort: grpcPort,
                grpcPortFileName: _scenario);

            localCasSettings.PreferredCacheDrive = Path.GetPathRoot(cacheRootPath);
            localCasSettings.ServiceSettings     = new LocalCasServiceSettings(60, scenarioName: _scenario, grpcPort: grpcPort, grpcPortFileName: _scenario, bufferSizeForGrpcCopies: bufferSizeForGrpcCopies);

            var redisConnectionString      = Environment.GetEnvironmentVariable(EnvironmentConnectionStringProvider.RedisConnectionStringEnvironmentVariable);
            var distributedContentSettings = DistributedContentSettings.CreateEnabled(new Dictionary <string, string>()
            {
                { host.StampId, redisConnectionString }
            });

            var config = new DistributedCacheServiceConfiguration(localCasSettings, distributedContentSettings);

            return(new DistributedCacheServiceArguments(_logger, copier, pathTransformer, distributedCacheServiceHost, host, ct, dataRootPath, config, null));
        }
        /// <inheritdoc />
        public DistributedCacheServiceArguments(
            ILogger logger,
            IAbsolutePathFileCopier copier,
            IAbsolutePathTransformer pathTransformer,
            IDistributedCacheServiceHost host,
            HostInfo hostInfo,
            CancellationToken cancellation,
            string dataRootPath,
            DistributedCacheServiceConfiguration configuration,
            string keyspace)
        {
            Logger          = logger;
            Copier          = copier;
            PathTransformer = pathTransformer;
            Host            = host;
            HostInfo        = hostInfo;
            Cancellation    = cancellation;
            DataRootPath    = dataRootPath;
            Configuration   = configuration;

            Keyspace = ComputeKeySpace(hostInfo, configuration, keyspace);
        }
Beispiel #4
0
        internal DistributedCacheServiceArguments CreateDistributedCacheServiceArguments(
            IAbsolutePathRemoteFileCopier copier,
            IAbsolutePathTransformer pathTransformer,
            IContentCommunicationManager copyRequester,
            DistributedContentSettings dcs,
            HostInfo host,
            string cacheName,
            string cacheRootPath,
            uint grpcPort,
            int maxSizeQuotaMB,
            string dataRootPath,
            CancellationToken ct,
            int?bufferSizeForGrpcCopies,
            int?gzipBarrierSizeForGrpcCopies,
            LoggingSettings loggingSettings,
            ITelemetryFieldsProvider telemetryFieldsProvider)
        {
            var distributedCacheServiceHost = new EnvironmentVariableHost();

            var localCasSettings = LocalCasSettings.Default(
                maxSizeQuotaMB: maxSizeQuotaMB,
                cacheRootPath: cacheRootPath,
                cacheName: cacheName,
                grpcPort: grpcPort,
                grpcPortFileName: _scenario);

            localCasSettings.PreferredCacheDrive = Path.GetPathRoot(cacheRootPath);
            localCasSettings.ServiceSettings     = new LocalCasServiceSettings(60, scenarioName: _scenario, grpcPort: grpcPort, grpcPortFileName: _scenario, bufferSizeForGrpcCopies: bufferSizeForGrpcCopies, gzipBarrierSizeForGrpcCopies: gzipBarrierSizeForGrpcCopies,
                                                                               grpcThreadPoolSize: null);

            var config = new DistributedCacheServiceConfiguration(localCasSettings, dcs, loggingSettings);

            return(new DistributedCacheServiceArguments(_logger, copier, pathTransformer, copyRequester, distributedCacheServiceHost, host, ct, dataRootPath, config, null)
            {
                TelemetryFieldsProvider = telemetryFieldsProvider,
            });
        }