Search in sources :

Example 31 with LogTailInformation

use of org.neo4j.kernel.impl.transaction.log.files.LogTailInformation in project neo4j by neo4j.

the class AbstractLogTailScannerTest method latestLogEmptyStartEntryBeforeAndAfterCheckPointInTheLastButOneLog.

@ParameterizedTest
@MethodSource("params")
void latestLogEmptyStartEntryBeforeAndAfterCheckPointInTheLastButOneLog(int startLogVersion, int endLogVersion) {
    // given
    long txId = 432;
    setupLogFiles(endLogVersion, logFile(start(), commit(1), checkPoint(), start(), commit(txId)), logFile());
    // when
    LogTailInformation logTailInformation = logFiles.getTailInformation();
    // then
    assertLatestCheckPoint(true, true, txId, false, logTailInformation);
}
Also used : LogTailInformation(org.neo4j.kernel.impl.transaction.log.files.LogTailInformation) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 32 with LogTailInformation

use of org.neo4j.kernel.impl.transaction.log.files.LogTailInformation in project neo4j by neo4j.

the class AbstractLogTailScannerTest method latestLogFileContainingACheckPointAndAStartAfter.

@ParameterizedTest
@MethodSource("params")
void latestLogFileContainingACheckPointAndAStartAfter(int startLogVersion, int endLogVersion) {
    // given
    long txId = 35;
    StartEntry start = start();
    setupLogFiles(endLogVersion, logFile(start, commit(txId), checkPoint(start)));
    // when
    LogTailInformation logTailInformation = logFiles.getTailInformation();
    // then
    assertLatestCheckPoint(true, true, txId, false, logTailInformation);
}
Also used : LogTailInformation(org.neo4j.kernel.impl.transaction.log.files.LogTailInformation) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 33 with LogTailInformation

use of org.neo4j.kernel.impl.transaction.log.files.LogTailInformation in project neo4j by neo4j.

the class AbstractLogTailScannerTest method olderLogFileContainingAStartAndNewerFileContainingACheckPointPointingToAPreviousPositionThanStart.

@ParameterizedTest
@MethodSource("params")
void olderLogFileContainingAStartAndNewerFileContainingACheckPointPointingToAPreviousPositionThanStart(int startLogVersion, int endLogVersion) {
    // given
    long txId = 123;
    StartEntry start = start();
    setupLogFiles(endLogVersion, logFile(start, commit(txId)), logFile(checkPoint(start)));
    // when
    LogTailInformation logTailInformation = logFiles.getTailInformation();
    // then
    assertLatestCheckPoint(true, true, txId, false, logTailInformation);
}
Also used : LogTailInformation(org.neo4j.kernel.impl.transaction.log.files.LogTailInformation) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 34 with LogTailInformation

use of org.neo4j.kernel.impl.transaction.log.files.LogTailInformation in project neo4j by neo4j.

the class AbstractLogTailScannerTest method noLogFilesFound.

@ParameterizedTest
@MethodSource("params")
void noLogFilesFound(int startLogVersion, int endLogVersion) {
    // given no files
    setupLogFiles(endLogVersion);
    // when
    LogTailInformation logTailInformation = logFiles.getTailInformation();
    // then
    assertLatestCheckPoint(false, false, NO_TRANSACTION_ID, true, logTailInformation);
}
Also used : LogTailInformation(org.neo4j.kernel.impl.transaction.log.files.LogTailInformation) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Aggregations

LogTailInformation (org.neo4j.kernel.impl.transaction.log.files.LogTailInformation)34 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)24 MethodSource (org.junit.jupiter.params.provider.MethodSource)23 LogPosition (org.neo4j.kernel.impl.transaction.log.LogPosition)7 Test (org.junit.jupiter.api.Test)6 Path (java.nio.file.Path)3 UnderlyingStorageException (org.neo4j.exceptions.UnderlyingStorageException)2 LogEntryStart (org.neo4j.kernel.impl.transaction.log.entry.LogEntryStart)2 LogFiles (org.neo4j.kernel.impl.transaction.log.files.LogFiles)2 CheckpointInfo (org.neo4j.kernel.impl.transaction.log.files.checkpoint.CheckpointInfo)2 ClosedByInterruptException (java.nio.channels.ClosedByInterruptException)1 DatabaseLayout (org.neo4j.io.layout.DatabaseLayout)1 LogEntryCursor (org.neo4j.kernel.impl.transaction.log.LogEntryCursor)1 LogVersionedStoreChannel (org.neo4j.kernel.impl.transaction.log.LogVersionedStoreChannel)1 ReadAheadLogChannel (org.neo4j.kernel.impl.transaction.log.ReadAheadLogChannel)1 LogEntry (org.neo4j.kernel.impl.transaction.log.entry.LogEntry)1 LogEntryCommit (org.neo4j.kernel.impl.transaction.log.entry.LogEntryCommit)1 LogEntryInlinedCheckPoint (org.neo4j.kernel.impl.transaction.log.entry.LogEntryInlinedCheckPoint)1 LogHeader (org.neo4j.kernel.impl.transaction.log.entry.LogHeader)1 LogFile (org.neo4j.kernel.impl.transaction.log.files.LogFile)1