Ejemplo n.º 1
0
 public Shard(IPersistentStore store, uint shardId, IClock clock, CacheKeyHasher hasher, PersistentCacheOptions options)
 {
     usage        = new UsageTracker(clock, options.UsageFrequencyHalfLifeMinutes);
     this.store   = store;
     this.shardId = shardId;
     this.options = options;
     evicter      = new Evicter.Evicter(shardId, store, usage, hasher, clock, options, shutdownTokenSource);
 }
 public PersistentCache(IPersistentStore store, IClock clock, PersistentCacheOptions options)
 {
     //TODO guard against null store, null clock, zero shardCount, or zero halflife
     this.store = store;
     hasher     = new CacheKeyHasher(options.ShardCount);
     shards     = new Shard[options.ShardCount];
     for (uint i = 0; i < options.ShardCount; i++)
     {
         shards[i] = new Shard(store, i, clock, hasher, options);
     }
 }