public Database(ILoggerFactory loggerFactory, DatatentSettings settings, IDataProcessingPipeline processingPipeline) { _settings = settings; _processingPipeline = processingPipeline; _fileSystemService = new FileSystemService(_settings, loggerFactory.CreateLogger <FileSystemService>()); _defaultScheduler = new DefaultScheduler(_fileSystemService); }
public static Database CreateNew(ILoggerFactory loggerFactory, string path, string password = "") { DatatentSettings settings = new DatatentSettings(); settings.DataFile = path; IDataProcessingPipeline processingPipeline = new DataProcessingPipeline(new UTF8JSonSerializer(), string.IsNullOrWhiteSpace(password) ? (IEncryptionService) new NullEncryptionService() : new AESEncryptionService(password), new Lz4CompressionService()); var database = new Database(loggerFactory, settings, processingPipeline); database.InitNew(); return(database); }