/// <summary> /// Initializes a new instance of the <see cref="FileSystemServiceBase"/> class. /// </summary> /// <param name="settings">The settings.</param> /// <param name="logger">The logger.</param> protected FileSystemServiceBase(DatatentSettings settings, ILogger <FileSystemServiceBase> logger) { _settings = settings; _logger = logger; _dataFileStream = new MemoryStream(); _logger.LogInformation($"Init file system service"); }
public static FileDiskService Create(DatatentSettings settings) { Guard.Argument(settings.InMemory).False(); Guard.Argument(settings.Path).NotWhiteSpace(); FileStream fileStream = new FileStream(settings.Path !, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.Read, Constants.PAGE_SIZE, FileOptions.RandomAccess); FileDiskService diskService = new(fileStream, settings); return(diskService); }
public MemoryFileSystemService(DatatentSettings settings, long size, ILogger <FileSystemServiceBase> logger) : base(settings, logger) { _dataFileStream = new MemoryStream(new byte[size], true); }
public FileSystemService(DatatentSettings settings, ILogger <FileSystemServiceBase> logger) : base(settings, logger) { _dataFileStream = new FileStream(settings.DataFile, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.Read, 4096, FileOptions.RandomAccess); }
protected FileSystemServiceBase(DatatentSettings settings, ILogger <FileSystemServiceBase> logger) { _settings = settings; _logger = logger; }
protected FileDiskService(Stream stream, DatatentSettings datatentSettings) : base(stream) { _datatentSettings = datatentSettings; }