private static List <Notification> CreateSampleNotificationsForFilterOutTest() { return(new List <Notification> { AlertRaised.Create( null, "DatabaseTopologyWarning", "DatabaseTopologyWarning_MSG", AlertType.DatabaseTopologyWarning, NotificationSeverity.Info), DatabaseChanged.Create(null, DatabaseChangeType.Put), // filtered out, DatabaseChange AlertRaised.Create( null, "LicenseManager_AGPL3", "LicenseManager_AGPL3_MSG", AlertType.ClusterTransactionFailure, NotificationSeverity.Info), AlertRaised.Create( null, "LicenseManager_AGPL3", "LicenseManager_AGPL3_MSG", AlertType.LicenseManager_AGPL3, // filtered out explicitly NotificationSeverity.Info), AlertRaised.Create( null, "RevisionsConfigurationNotValid", "RevisionsConfigurationNotValid_MSG", AlertType.RevisionsConfigurationNotValid, // filtered out explicitly NotificationSeverity.Info), AlertRaised.Create( null, "Certificates_ReplaceError", "Certificates_ReplaceError_MSG", AlertType.Certificates_ReplaceError, NotificationSeverity.Info), PerformanceHint.Create( null, "SlowIO", "SlowIO_MSG", PerformanceHintType.SlowIO, // filtered out, PerformanceHint NotificationSeverity.Info, "test"), PerformanceHint.Create( null, "SqlEtl_SlowSql", "SqlEtl_SlowSql_MSG", PerformanceHintType.SqlEtl_SlowSql, // filtered out, PerformanceHint NotificationSeverity.Info, "test"), OperationChanged.Create(null, 1, new Operations.OperationDescription(), new OperationState() { Result = new PersistableResult() }, false), DatabaseChanged.Create(null, DatabaseChangeType.Delete) // filtered out, DatabaseChange }); }
private DocumentDatabase ActuallyCreateDatabase(StringSegment databaseName, RavenConfiguration config, DateTime?wakeup = null) { IDisposable release = null; try { if (_serverStore.Disposed) { ThrowServerIsBeingDisposed(databaseName); } //if false, this means we have started disposing, so we shouldn't create a database now release = EnterReadLockImmediately(databaseName); var db = CreateDocumentsStorage(databaseName, config, wakeup); _serverStore.NotificationCenter.Add( DatabaseChanged.Create(databaseName.Value, DatabaseChangeType.Load)); return(db); } catch (Exception e) { // if we are here, there is an error, and if there is an error, we need to clear it from the // resource store cache so we can try to reload it. // Note that we return the faulted task anyway, because we need the user to look at the error if (e.Data.Contains("Raven/KeepInResourceStore") == false) { DatabasesCache.TryRemove(databaseName, out _); } if (_logger.IsInfoEnabled && e.InnerException is UnauthorizedAccessException) { _logger.Info("Failed to load database because couldn't access certain file. Please check permissions, and make sure that nothing locks that file (an antivirus is a good example of something that can lock the file)", e); } throw; } finally { try { _databaseSemaphore.Release(); } catch (ObjectDisposedException) { // nothing to do } release?.Dispose(); } }
private DocumentDatabase ActuallyCreateDatabase(StringSegment databaseName, RavenConfiguration config, DateTime?wakeup = null) { IDisposable release = null; try { if (_serverStore.Disposed) { ThrowServerIsBeingDisposed(databaseName); } //if false, this means we have started disposing, so we shouldn't create a database now release = EnterReadLockImmediately(databaseName); var db = CreateDocumentsStorage(databaseName, config, wakeup); _serverStore.NotificationCenter.Add( DatabaseChanged.Create(databaseName.Value, DatabaseChangeType.Load)); return(db); } catch (Exception e) { if (_logger.IsInfoEnabled && e.InnerException is UnauthorizedAccessException) { _logger.Info("Failed to load database because couldn't access certain file. Please check permissions, and make sure that nothing locks that file (an antivirus is a good example of something that can lock the file)", e); } throw; } finally { try { _databaseSemaphore.Release(); } catch (ObjectDisposedException) { // nothing to do } release?.Dispose(); } }