Exemple #1
0
        /// <summary>
        /// Build log files that can access and operate only on active set of log files without ability to
        /// rotate and create any new one. Appending to current log file still possible.
        /// Store and external components access available in read only mode. </summary>
        /// <param name="databaseLayout"> store directory </param>
        /// <param name="fileSystem"> log file system </param>
        /// <param name="pageCache"> page cache for read only store info access </param>
        public static LogFilesBuilder ActiveFilesBuilder(DatabaseLayout databaseLayout, FileSystemAbstraction fileSystem, PageCache pageCache)
        {
            LogFilesBuilder builder = builder(databaseLayout, fileSystem);

            builder._pageCache = pageCache;
            builder._readOnly  = true;
            return(builder);
        }
Exemple #2
0
        /// <summary>
        /// Builder for fully functional transactional log files.
        /// Log files will be able to access store and external components information, perform rotations, etc. </summary>
        /// <param name="databaseLayout"> database directory </param>
        /// <param name="fileSystem"> log files filesystem </param>
        public static LogFilesBuilder Builder(DatabaseLayout databaseLayout, FileSystemAbstraction fileSystem)
        {
            LogFilesBuilder filesBuilder = new LogFilesBuilder();

            filesBuilder._databaseLayout = databaseLayout;
            filesBuilder._fileSystem     = fileSystem;
            return(filesBuilder);
        }
Exemple #3
0
        /// <summary>
        /// Build log files that will be able to perform only operations on a log files directly.
        /// Any operation that will require access to a store or other parts of runtime will fail.
        /// Should be mainly used only for testing purposes or when only file based operations will be performed </summary>
        /// <param name="logsDirectory"> log files directory </param>
        /// <param name="fileSystem"> file system </param>
        public static LogFilesBuilder LogFilesBasedOnlyBuilder(File logsDirectory, FileSystemAbstraction fileSystem)
        {
            LogFilesBuilder builder = new LogFilesBuilder();

            builder._logsDirectory           = logsDirectory;
            builder._fileSystem              = fileSystem;
            builder._fileBasedOperationsOnly = true;
            return(builder);
        }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private LogFiles createLogFiles() throws java.io.IOException
        private LogFiles CreateLogFiles()
        {
            return(LogFilesBuilder.Builder(TestDirectory.databaseLayout(), FileSystemRule).withLogFileName(_filename).withTransactionIdStore(new SimpleTransactionIdStore()).withLogVersionRepository(new SimpleLogVersionRepository()).build());
        }