public CounterStorage(string serverUrl, string counterStorageStorageName, InMemoryRavenConfiguration configuration)
		{
            CounterStorageUrl = String.Format("{0}counters/{1}", serverUrl, counterStorageStorageName);
            CounterStorageName = counterStorageStorageName;
                
			var options = configuration.RunInMemory ? StorageEnvironmentOptions.CreateMemoryOnly()
				: CreateStorageOptionsFromConfiguration(configuration.CountersDataDirectory, configuration.Settings);

			storageEnvironment = new StorageEnvironment(options);
            ReplicationTask = new RavenCounterReplication(this);
		   
		    ReplicationTimeoutInMs = configuration.GetConfigurationValue<int>("Raven/Replication/ReplicationRequestTimeout") ?? 60*1000;

            Initialize();
		}
Exemple #2
0
		public CounterStorage(string serverUrl, string storageName, InMemoryRavenConfiguration configuration, TransportState recievedTransportState = null)
		{
            CounterStorageUrl = String.Format("{0}counters/{1}", serverUrl, storageName);
            Name = storageName;
                
			var options = configuration.RunInMemory ? StorageEnvironmentOptions.CreateMemoryOnly()
				: CreateStorageOptionsFromConfiguration(configuration.CountersDataDirectory, configuration.Settings);

			storageEnvironment = new StorageEnvironment(options);
            ReplicationTask = new RavenCounterReplication(this);

			//TODO: add an option to create a ReplicationRequestTimeout when creating a new counter storage
		    ReplicationTimeoutInMs = configuration.GetConfigurationValue<int>("Raven/Replication/ReplicationRequestTimeout") ?? 60*1000;

            metricsCounters = new CountersMetricsManager();
			transportState = recievedTransportState ?? new TransportState();
            Initialize();
		}
Exemple #3
0
        public CounterStorage(string serverUrl, string storageName, InMemoryRavenConfiguration configuration, TransportState recievedTransportState = null)
        {
            CounterStorageUrl = String.Format("{0}counters/{1}", serverUrl, storageName);
            Name = storageName;
            ResourceName = string.Concat(Constants.Counter.UrlPrefix, "/", storageName);
                
            var options = configuration.RunInMemory ? StorageEnvironmentOptions.CreateMemoryOnly()
                : CreateStorageOptionsFromConfiguration(configuration.CountersDataDirectory, configuration.Settings);

            storageEnvironment = new StorageEnvironment(options);
            ReplicationTask = new RavenCounterReplication(this);

            //TODO: add an option to create a ReplicationRequestTimeout when creating a new counter storage
            ReplicationTimeoutInMs = configuration.Replication.ReplicationRequestTimeoutInMilliseconds;

            metricsCounters = new CountersMetricsManager();
            transportState = recievedTransportState ?? new TransportState();
            Configuration = configuration;
            ExtensionsState = new AtomicDictionary<object>();
            Initialize();
        }