Exemplo n.º 1
0
 public static extern PalFlags.FailCodes rvn_open_journal_for_writes(
     string fileName,
     PalFlags.JournalMode mode,
     Int64 requiredSize,
     PalFlags.DurabilityMode supportDurability,
     out SafeJournalHandle handle,
     out Int64 actualSize,
     out Int32 errorCode);
Exemplo n.º 2
0
 public static PalFlags.FailCodes rvn_open_journal_for_writes(
     string filename,
     PalFlags.JournalMode mode,
     Int64 requiredSize,
     PalFlags.DurabilityMode supportDurability,
     out SafeJournalHandle handle,
     out Int64 actualSize,
     out Int32 errorCode)
 {
     using (var convert = new Converter(filename))
     {
         return(rvn_open_journal_for_writes(convert.Pointer,
                                            mode,
                                            requiredSize,
                                            supportDurability,
                                            out handle,
                                            out actualSize,
                                            out errorCode));
     }
 }
Exemplo n.º 3
0
        public JournalWriter(StorageEnvironmentOptions options, VoronPathSetting filename, long size, PalFlags.JournalMode mode = PalFlags.JournalMode.Safe)
        {
            _options = options;
            FileName = filename;
            _log     = LoggingSource.Instance.GetLogger <JournalWriter>(options.BasePath.FullPath);

            var result = Pal.rvn_open_journal_for_writes(filename.FullPath, mode, size, options.SupportDurabilityFlags, out _writeHandle, out var actualSize, out var error);

            if (result != PalFlags.FailCodes.Success)
            {
                PalHelper.ThrowLastError(result, error, $"Attempted to open journal file - Path: {filename.FullPath} Size :{size}");
            }

            NumberOfAllocated4Kb = (int)(actualSize / (4 * Constants.Size.Kilobyte));
        }