/// <summary> /// Creates an ArchiveList /// </summary> /// <param name="settings">The settings for the archive list. Null will revert to a default setting.</param> public ArchiveList(ArchiveListSettings settings = null) { if (settings == null) { settings = new ArchiveListSettings(); } m_settings = settings.CloneReadonly(); m_settings.Validate(); m_syncRoot = new object(); m_fileSummaries = new SortedList <Guid, ArchiveTableSummary <TKey, TValue> >(); m_allSnapshots = new WeakList <ArchiveListSnapshot <TKey, TValue> >(); m_listLog = new ArchiveListLog(m_settings.LogSettings); m_filesToDelete = new List <SortedTreeTable <TKey, TValue> >(); m_filesToDispose = new List <SortedTreeTable <TKey, TValue> >(); m_processRemovals = new ScheduledTask(ThreadingMode.DedicatedBackground); m_processRemovals.Running += ProcessRemovals_Running; m_processRemovals.Disposing += ProcessRemovals_Disposing; m_processRemovals.UnhandledException += ProcessRemovals_UnhandledException; AttachFileOrPath(m_settings.ImportPaths); HashSet <Guid> files = new HashSet <Guid>(m_filesToDelete.Select(x => x.ArchiveId)); m_listLog.ClearCompletedLogs(files); }
/// <summary> /// Creates a new <see cref="ServerDatabaseSettings"/> /// </summary> public ServerDatabaseSettings() { m_databaseName = string.Empty; m_archiveList = new ArchiveListSettings(); m_writeProcessor = new WriteProcessorSettings(); m_rolloverLog = new RolloverLogSettings(); m_keyType = Guid.Empty; m_valueType = Guid.Empty; m_streamingEncodingMethods = new ImmutableList <EncodingDefinition>(x => { if (x is null) { throw new ArgumentNullException("value"); } return(x); }); }