public AzureTableCachedStorageAccess(CachePolicy policy, string name, string key, bool useHttps, string tableNamePrefix, string deploymentId) { Assert.IsNotNull(policy, "policy"); this.logger = EventStoreLogger.Logger; this.cachingPolicy = policy; this.tableExistsMap = new Dictionary <string, bool>(); this.LastCacheTelemetryDump = DateTimeOffset.UtcNow; this.cancellationTokenSourceForBackgroundUpdater = null; this.azureTableDirectAccess = new AccountAndKeyTableStorageAccess(name, key, useHttps); this.nodeCache = new Cache <AzureTableCacheKey, AzureTableCacheValue>( "NodeCache", new InMemorySortedStore <AzureTableCacheKey, AzureTableCacheValue>(), new DataFetcher <AzureTableCacheKey, AzureTableCacheValue>(Mapping.NodeTable, tableNamePrefix, deploymentId, this.cachingPolicy.MaxCacheItemCount, this.azureTableDirectAccess), this.cachingPolicy); this.partitionCache = new Cache <AzureTableCacheKey, AzureTableCacheValue>( "PartitionCache", new InMemorySortedStore <AzureTableCacheKey, AzureTableCacheValue>(), new DataFetcher <AzureTableCacheKey, AzureTableCacheValue>(Mapping.PartitionTable, tableNamePrefix, deploymentId, this.cachingPolicy.MaxCacheItemCount, this.azureTableDirectAccess), this.cachingPolicy); this.applicationCache = new Cache <AzureTableCacheKey, AzureTableCacheValue>( "ApplicationCache", new InMemorySortedStore <AzureTableCacheKey, AzureTableCacheValue>(), new DataFetcher <AzureTableCacheKey, AzureTableCacheValue>(Mapping.AppTable, tableNamePrefix, deploymentId, this.cachingPolicy.MaxCacheItemCount, this.azureTableDirectAccess), this.cachingPolicy); this.serviceCache = new Cache <AzureTableCacheKey, AzureTableCacheValue>( "ServiceCache", new InMemorySortedStore <AzureTableCacheKey, AzureTableCacheValue>(), new DataFetcher <AzureTableCacheKey, AzureTableCacheValue>(Mapping.ServiceTable, tableNamePrefix, deploymentId, this.cachingPolicy.MaxCacheItemCount, this.azureTableDirectAccess), this.cachingPolicy); this.replicaCache = new Cache <AzureTableCacheKey, AzureTableCacheValue>( "ReplicaCache", new InMemorySortedStore <AzureTableCacheKey, AzureTableCacheValue>(), new DataFetcher <AzureTableCacheKey, AzureTableCacheValue>(Mapping.ReplicaTable, tableNamePrefix, deploymentId, this.cachingPolicy.MaxCacheItemCount, this.azureTableDirectAccess), this.cachingPolicy); this.clusterCache = new Cache <AzureTableCacheKey, AzureTableCacheValue>( "ClusterCache", new InMemorySortedStore <AzureTableCacheKey, AzureTableCacheValue>(), new DataFetcher <AzureTableCacheKey, AzureTableCacheValue>(Mapping.ClusterTable, tableNamePrefix, deploymentId, this.cachingPolicy.MaxCacheItemCount, this.azureTableDirectAccess), this.cachingPolicy); this.correlationCache = new Cache <AzureTableCacheKey, AzureTableCacheValue>( "CorrelationCache", new InMemorySortedStore <AzureTableCacheKey, AzureTableCacheValue>(), new DataFetcher <AzureTableCacheKey, AzureTableCacheValue>(Mapping.CorrelationTable, tableNamePrefix, deploymentId, this.cachingPolicy.MaxCacheItemCount, this.azureTableDirectAccess), this.cachingPolicy); this.cacheList = new List <Cache <AzureTableCacheKey, AzureTableCacheValue> >(); this.cacheList.Add(this.nodeCache); this.cacheList.Add(this.partitionCache); this.cacheList.Add(this.applicationCache); this.cacheList.Add(this.serviceCache); this.cacheList.Add(this.replicaCache); this.cacheList.Add(this.clusterCache); this.cacheList.Add(this.correlationCache); }
// For Debugging internal static void Dump(Cache <AzureTableCacheKey, AzureTableCacheValue> cache, string fileName) { cache.Dump(cache.Name + fileName); }