public CassandraMembershipTable(
            IOptions <ClusterOptions> clusterOptions,
            IOptions <CassandraClusteringOptions> cassandraClusteringOptions,
            ILogger <CassandraMembershipTable> logger,
            ILoggerProvider loggerProvider)
        {
            _clusterId = clusterOptions.Value.ClusterId;
            _cassandraClusteringOptions = cassandraClusteringOptions.Value;
            _logger = logger;

            Diagnostics.CassandraPerformanceCountersEnabled = _cassandraClusteringOptions.Diagnostics.PerformanceCountersEnabled;
            Diagnostics.CassandraStackTraceIncluded         = _cassandraClusteringOptions.Diagnostics.StackTraceIncluded;

            if (loggerProvider != null)
            {
                Diagnostics.AddLoggerProvider(loggerProvider);
            }
        }
Ejemplo n.º 2
0
        public CassandraGatewayListProvider(
            IOptions <ClusterOptions> clusterOptions,
            IOptions <GatewayOptions> gatewayOptions,
            IOptions <CassandraClusteringOptions> cassandraClusteringOptions,
            ILogger <CassandraGatewayListProvider> logger,
            ILoggerProvider loggerProvider)
        {
            _clusterId = clusterOptions.Value.ClusterId;
            _cassandraClusteringOptions = cassandraClusteringOptions.Value;
            _logger      = logger;
            MaxStaleness = gatewayOptions.Value.GatewayListRefreshPeriod;

            Diagnostics.CassandraPerformanceCountersEnabled = _cassandraClusteringOptions.Diagnostics.PerformanceCountersEnabled;
            Diagnostics.CassandraStackTraceIncluded         = _cassandraClusteringOptions.Diagnostics.StackTraceIncluded;

            if (loggerProvider != null)
            {
                Diagnostics.AddLoggerProvider(loggerProvider);
            }
        }