Exemple #1
0
        public Database(ILoggerFactory loggerFactory, DatatentSettings settings, IDataProcessingPipeline processingPipeline)
        {
            _settings           = settings;
            _processingPipeline = processingPipeline;

            _fileSystemService = new FileSystemService(_settings, loggerFactory.CreateLogger <FileSystemService>());
            _defaultScheduler  = new DefaultScheduler(_fileSystemService);
        }
Exemple #2
0
        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);
        }