public DeleteServiceTests() { _indexDataStore = Substitute.For <IIndexDataStore>(); _metadataStore = Substitute.For <IMetadataStore>(); _fileDataStore = Substitute.For <IFileStore>(); _indexDataStoreFactory = Substitute.For <IIndexDataStoreFactory>(); _deleteConfiguration = new DeletedInstanceCleanupConfiguration { DeleteDelay = TimeSpan.FromDays(1), BatchSize = 10, MaxRetries = 5, PollingInterval = TimeSpan.FromSeconds(1), RetryBackOff = TimeSpan.FromDays(4), }; IOptions <DeletedInstanceCleanupConfiguration> deletedInstanceCleanupConfigurationOptions = Substitute.For <IOptions <DeletedInstanceCleanupConfiguration> >(); deletedInstanceCleanupConfigurationOptions.Value.Returns(_deleteConfiguration); ITransactionHandler transactionHandler = Substitute.For <ITransactionHandler>(); _transactionScope = Substitute.For <ITransactionScope>(); transactionHandler.BeginTransaction().Returns(_transactionScope); _indexDataStoreFactory.GetInstance().Returns(_indexDataStore); _deleteService = new DeleteService(_indexDataStoreFactory, _metadataStore, _fileDataStore, deletedInstanceCleanupConfigurationOptions, transactionHandler, NullLogger <DeleteService> .Instance); }
public BackgroundServiceHealthCheck( IIndexDataStoreFactory indexDataStoreFactory, IOptions <DeletedInstanceCleanupConfiguration> deletedInstanceCleanupConfiguration, TelemetryClient telemetryClient, BackgroundServiceHealthCheckCache backgroundServiceHealthCheckCache) { EnsureArg.IsNotNull(indexDataStoreFactory, nameof(indexDataStoreFactory)); EnsureArg.IsNotNull(deletedInstanceCleanupConfiguration?.Value, nameof(deletedInstanceCleanupConfiguration)); EnsureArg.IsNotNull(telemetryClient, nameof(telemetryClient)); EnsureArg.IsNotNull(backgroundServiceHealthCheckCache, nameof(backgroundServiceHealthCheckCache)); _indexDataStore = indexDataStoreFactory.GetInstance(); _deletedInstanceCleanupConfiguration = deletedInstanceCleanupConfiguration.Value; _telemetryClient = telemetryClient; _backgroundServiceHealthCheckCache = backgroundServiceHealthCheckCache; }
public StoreOrchestrator( IFileStore fileStore, IMetadataStore metadataStore, IIndexDataStoreFactory indexDataStoreFactory, IDeleteService deleteService, IQueryTagService queryTagService) { EnsureArg.IsNotNull(fileStore, nameof(fileStore)); EnsureArg.IsNotNull(metadataStore, nameof(metadataStore)); EnsureArg.IsNotNull(indexDataStoreFactory, nameof(indexDataStoreFactory)); EnsureArg.IsNotNull(deleteService, nameof(deleteService)); EnsureArg.IsNotNull(queryTagService, nameof(queryTagService)); _fileStore = fileStore; _metadataStore = metadataStore; _deleteService = deleteService; _queryTagService = queryTagService; _indexDataStore = indexDataStoreFactory.GetInstance(); }
public DeleteService( IIndexDataStoreFactory indexDataStoreFactory, IMetadataStore metadataStore, IFileStore fileStore, IOptions <DeletedInstanceCleanupConfiguration> deletedInstanceCleanupConfiguration, ITransactionHandler transactionHandler, ILogger <DeleteService> logger) { EnsureArg.IsNotNull(indexDataStoreFactory, nameof(indexDataStoreFactory)); EnsureArg.IsNotNull(metadataStore, nameof(metadataStore)); EnsureArg.IsNotNull(fileStore, nameof(fileStore)); EnsureArg.IsNotNull(deletedInstanceCleanupConfiguration?.Value, nameof(deletedInstanceCleanupConfiguration)); EnsureArg.IsNotNull(transactionHandler, nameof(transactionHandler)); EnsureArg.IsNotNull(logger, nameof(logger)); _indexDataStore = indexDataStoreFactory.GetInstance(); _metadataStore = metadataStore; _fileStore = fileStore; _deletedInstanceCleanupConfiguration = deletedInstanceCleanupConfiguration.Value; _transactionHandler = transactionHandler; _logger = logger; }