Ejemplo n.º 1
0
 /// <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");
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 public MemoryFileSystemService(DatatentSettings settings, long size, ILogger <FileSystemServiceBase> logger) : base(settings, logger)
 {
     _dataFileStream = new MemoryStream(new byte[size], true);
 }
Ejemplo n.º 4
0
 public FileSystemService(DatatentSettings settings, ILogger <FileSystemServiceBase> logger) : base(settings, logger)
 {
     _dataFileStream = new FileStream(settings.DataFile, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.Read, 4096, FileOptions.RandomAccess);
 }
Ejemplo n.º 5
0
 protected FileSystemServiceBase(DatatentSettings settings, ILogger <FileSystemServiceBase> logger)
 {
     _settings = settings;
     _logger   = logger;
 }
Ejemplo n.º 6
0
 protected FileDiskService(Stream stream, DatatentSettings datatentSettings) : base(stream)
 {
     _datatentSettings = datatentSettings;
 }