public override AbstractPager CreateScratchPager(string name, long initialSize) { var guid = Guid.NewGuid(); var filename = $"ravendb-{Process.GetCurrentProcess().Id}-{_instanceId}-{name}-{guid}"; return(GetTempMemoryMapPager(this, TempPath.Combine(filename), initialSize, Win32NativeFileAttributes.RandomAccess | Win32NativeFileAttributes.DeleteOnClose | Win32NativeFileAttributes.Temporary)); }
public override VoronPathSetting GetJournalPath(long journalNumber) { var name = JournalName(journalNumber); var filename = $"ravendb-{Process.GetCurrentProcess().Id}-{_instanceId}-{name}-{Guid.NewGuid()}"; return(TempPath.Combine(filename)); }
// This is used for special pagers that are used as temp buffers and don't // require encryption: compression, recovery, lazyTxBuffer. public override AbstractPager CreateTemporaryBufferPager(string name, long initialSize) { var scratchFile = TempPath.Combine(name); if (File.Exists(scratchFile.FullPath)) { File.Delete(scratchFile.FullPath); } return(GetMemoryMapPagerInternal(this, initialSize, scratchFile, deleteOnClose: true)); }
public PureMemoryStorageEnvironmentOptions(string name, VoronPathSetting tempPath, IoChangesNotifications ioChangesNotifications, CatastrophicFailureNotification catastrophicFailureNotification) : base(tempPath, ioChangesNotifications, catastrophicFailureNotification) { _name = name; _instanceId = Interlocked.Increment(ref _counter); var guid = Guid.NewGuid(); var filename = $"ravendb-{Process.GetCurrentProcess().Id}-{_instanceId}-data.pager-{guid}"; WinOpenFlags = Win32NativeFileAttributes.Temporary | Win32NativeFileAttributes.DeleteOnClose; if (Directory.Exists(tempPath.FullPath) == false) { Directory.CreateDirectory(tempPath.FullPath); } _dataPager = new Lazy <AbstractPager>(() => GetTempMemoryMapPager(this, TempPath.Combine(filename), InitialFileSize, Win32NativeFileAttributes.RandomAccess | Win32NativeFileAttributes.DeleteOnClose | Win32NativeFileAttributes.Temporary), true); }