/// <inheritdoc /> public Task <IContentLocationStore> CreateAsync(MachineLocation localMachineLocation) { IContentLocationStore contentLocationStore = null; if (Configuration.HasReadOrWriteMode(ContentLocationMode.Redis)) { var redisDatabaseAdapter = CreateDatabase(RedisDatabaseFactoryForContent); var machineLocationRedisDatabaseAdapter = CreateDatabase(RedisDatabaseFactoryForMachineLocations); contentLocationStore = new RedisContentLocationStore( redisDatabaseAdapter, machineLocationRedisDatabaseAdapter, Clock, _contentHashBumpTime, localMachineLocation.Data, Configuration); } if (Configuration.HasReadOrWriteMode(ContentLocationMode.LocalLocationStore)) { Contract.Assert(RedisDatabaseFactoryForRedisGlobalStore != null); var redisDatabaseForGlobalStore = CreateDatabase(RedisDatabaseFactoryForRedisGlobalStore); var secondaryRedisDatabaseForGlobalStore = CreateDatabase(RedisDatabaseFactoryForRedisGlobalStoreSecondary, optional: true); IGlobalLocationStore globalStore = new RedisGlobalStore(Clock, Configuration, localMachineLocation, redisDatabaseForGlobalStore, secondaryRedisDatabaseForGlobalStore); var localLocationStore = new LocalLocationStore(Clock, globalStore, Configuration); contentLocationStore = new TransitioningContentLocationStore(Configuration, (RedisContentLocationStore)contentLocationStore, localLocationStore, Clock); } return(Task.FromResult(contentLocationStore)); }
protected virtual LocalLocationStore CreateLocalLocationStore() { Contract.Assert(RedisDatabaseFactoryForRedisGlobalStore != null); var globalStore = CreateRedisGlobalStore(); var localLocationStore = new LocalLocationStore(Clock, globalStore, Configuration, Copier); return(localLocationStore); }
private LocalLocationStore CreateLocalLocationStore() { Contract.Assert(RedisDatabaseFactoryForRedisGlobalStore != null); var redisDatabaseForGlobalStore = CreateDatabase(RedisDatabaseFactoryForRedisGlobalStore, "primaryRedisDatabase"); var secondaryRedisDatabaseForGlobalStore = CreateDatabase(RedisDatabaseFactoryForRedisGlobalStoreSecondary, "secondaryRedisDatabase", optional: true); IGlobalLocationStore globalStore = new RedisGlobalStore(Clock, Configuration, redisDatabaseForGlobalStore, secondaryRedisDatabaseForGlobalStore); var localLocationStore = new LocalLocationStore(Clock, globalStore, Configuration, _copier); return(localLocationStore); }
/// <summary> /// Attempts to get local location store if enabled /// </summary> public bool TryGetLocalLocationStore(out LocalLocationStore localLocationStore) { if (_contentLocationStore is TransitioningContentLocationStore tcs && tcs.IsLocalLocationStoreEnabled) { localLocationStore = tcs.LocalLocationStore; return(true); } localLocationStore = null; return(false); }
/// <nodoc /> public TransitioningContentLocationStore( RedisContentLocationStoreConfiguration configuration, RedisContentLocationStore redisContentLocationStore, LocalLocationStore localLocationStore) { Contract.Requires(configuration != null); _configuration = configuration; _localLocationStore = localLocationStore; _redisContentLocationStore = redisContentLocationStore; Contract.Assert(!_configuration.HasReadOrWriteMode(ContentLocationMode.Redis) || _redisContentLocationStore != null); Contract.Assert(!_configuration.HasReadOrWriteMode(ContentLocationMode.LocalLocationStore) || _localLocationStore != null); }
/// <nodoc /> public TransitioningContentLocationStore( RedisContentLocationStoreConfiguration configuration, LocalLocationStore localLocationStore, MachineLocation localMachineLocation, ILocalContentStore localContentStore) { Contract.Requires(configuration != null); Contract.Requires(localMachineLocation.IsValid); LocalContentStore = localContentStore; _configuration = configuration; LocalLocationStore = localLocationStore; LocalMachineLocation = localMachineLocation; }
/// <nodoc /> public DistributedMemoizationDatabase(LocalLocationStore localLocationStore, MemoizationDatabase sharedDatabase) { _localDatabase = new RocksDbMemoizationDatabase(localLocationStore.Database, ownsDatabase: false); _sharedDatabase = sharedDatabase; _localLocationStore = localLocationStore; }
public DistributedCentralStorageLocationStoreAdapter(LocalLocationStore store) { _store = store; }