Esempio n. 1
0
 internal TransactionLogFileInformation(LogFiles logFiles, LogHeaderCache logHeaderCache, TransactionLogFilesContext context)
 {
     this._logFiles               = logFiles;
     this._logHeaderCache         = logHeaderCache;
     this._logFileContext         = context;
     this._logFileTimestampMapper = new TransactionLogFileTimestampMapper(logFiles, context.LogEntryReader);
 }
Esempio n. 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void buildFilesBasedContext() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void BuildFilesBasedContext()
        {
            TransactionLogFilesContext context = logFilesBasedOnlyBuilder(_storeDirectory, _fileSystem).buildContext();

            assertEquals(_fileSystem, context.FileSystem);
            assertSame(LogFileCreationMonitor_Fields.NoMonitor, context.LogFileCreationMonitor);
        }
Esempio n. 3
0
 internal TransactionLogFile(TransactionLogFiles logFiles, TransactionLogFilesContext context)
 {
     this._rotateAtSize           = context.RotationThreshold;
     this._context                = context;
     this._logFiles               = logFiles;
     this._readerLogVersionBridge = new ReaderLogVersionBridge(logFiles);
 }
Esempio n. 4
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public LogFiles build() throws java.io.IOException
        public virtual LogFiles Build()
        {
            TransactionLogFilesContext filesContext = BuildContext();
            File logsDirectory = LogsDirectory;

            filesContext.FileSystem.mkdirs(logsDirectory);
            return(new TransactionLogFiles(logsDirectory, _logFileName, filesContext));
        }
Esempio n. 5
0
 internal TransactionLogFiles(File logsDirectory, string name, TransactionLogFilesContext context)
 {
     this._logFilesContext    = context;
     this._logsDirectory      = logsDirectory;
     this._fileHelper         = new TransactionLogFilesHelper(logsDirectory, name);
     this._fileSystem         = context.FileSystem;
     this._monitor            = context.LogFileCreationMonitor;
     this._logHeaderCache     = new LogHeaderCache(1000);
     this._logFileInformation = new TransactionLogFileInformation(this, _logHeaderCache, context);
     this._logFile            = new TransactionLogFile(this, context);
 }
Esempio n. 6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void buildDefaultContext() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void BuildDefaultContext()
        {
            TransactionLogFilesContext context = builder(TestDirectory.databaseLayout(), _fileSystem).withLogVersionRepository(new SimpleLogVersionRepository(2)).withTransactionIdStore(new SimpleTransactionIdStore()).buildContext();

            assertEquals(_fileSystem, context.FileSystem);
            assertNotNull(context.LogEntryReader);
            assertSame(LogFileCreationMonitor_Fields.NoMonitor, context.LogFileCreationMonitor);
            assertEquals(ByteUnit.mebiBytes(250), context.RotationThreshold.get());
            assertEquals(1, context.LastCommittedTransactionId);
            assertEquals(2, context.LogVersionRepository.CurrentLogVersion);
        }
Esempio n. 7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void buildActiveFilesOnlyContext() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void BuildActiveFilesOnlyContext()
        {
            PageCache pageCache = PageCacheRule.getPageCache(_fileSystem);
            TransactionLogFilesContext context = activeFilesBuilder(TestDirectory.databaseLayout(), _fileSystem, pageCache).buildContext();

            assertEquals(_fileSystem, context.FileSystem);
            assertNotNull(context.LogEntryReader);
            assertSame(LogFileCreationMonitor_Fields.NoMonitor, context.LogFileCreationMonitor);
            assertEquals(long.MaxValue, context.RotationThreshold.get());
            assertEquals(0, context.LastCommittedTransactionId);
            assertEquals(0, context.LogVersionRepository.CurrentLogVersion);
        }
Esempio n. 8
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void buildDefaultContextWithDependencies() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void BuildDefaultContextWithDependencies()
        {
            SimpleLogVersionRepository logVersionRepository = new SimpleLogVersionRepository(2);
            SimpleTransactionIdStore   transactionIdStore   = new SimpleTransactionIdStore();
            Dependencies dependencies = new Dependencies();

            dependencies.SatisfyDependency(logVersionRepository);
            dependencies.SatisfyDependency(transactionIdStore);

            TransactionLogFilesContext context = builder(TestDirectory.databaseLayout(), _fileSystem).withDependencies(dependencies).buildContext();

            assertEquals(_fileSystem, context.FileSystem);
            assertNotNull(context.LogEntryReader);
            assertSame(LogFileCreationMonitor_Fields.NoMonitor, context.LogFileCreationMonitor);
            assertEquals(ByteUnit.mebiBytes(250), context.RotationThreshold.get());
            assertEquals(1, context.LastCommittedTransactionId);
            assertEquals(2, context.LogVersionRepository.CurrentLogVersion);
        }