Search in sources :

Example 11 with LatestCheckPoint

use of org.neo4j.kernel.recovery.LatestCheckPointFinder.LatestCheckPoint in project neo4j by neo4j.

the class LatestCheckPointFinderTest method noLogFilesFound.

@Test
public void noLogFilesFound() throws Throwable {
    // given no files
    setupLogFiles();
    int logVersion = startLogVersion;
    LatestCheckPointFinder finder = new LatestCheckPointFinder(logFiles, fsRule.get(), reader);
    // when
    LatestCheckPoint latestCheckPoint = finder.find(logVersion);
    // then
    assertLatestCheckPoint(false, false, NO_TRANSACTION_ID, -1, latestCheckPoint);
}
Also used : LatestCheckPoint(org.neo4j.kernel.recovery.LatestCheckPointFinder.LatestCheckPoint) LatestCheckPoint(org.neo4j.kernel.recovery.LatestCheckPointFinder.LatestCheckPoint) Test(org.junit.Test)

Example 12 with LatestCheckPoint

use of org.neo4j.kernel.recovery.LatestCheckPointFinder.LatestCheckPoint in project neo4j by neo4j.

the class LatestCheckPointFinderTest method latestLogFileContainingACheckPointAndAStartAfter.

@Test
public void latestLogFileContainingACheckPointAndAStartAfter() throws Throwable {
    // given
    long txId = 35;
    StartEntry start = start();
    setupLogFiles(logFile(start, commit(txId), checkPoint(start)));
    // when
    LatestCheckPoint latestCheckPoint = finder.find(endLogVersion);
    // then
    assertLatestCheckPoint(true, true, txId, endLogVersion, latestCheckPoint);
}
Also used : LatestCheckPoint(org.neo4j.kernel.recovery.LatestCheckPointFinder.LatestCheckPoint) Test(org.junit.Test)

Example 13 with LatestCheckPoint

use of org.neo4j.kernel.recovery.LatestCheckPointFinder.LatestCheckPoint in project neo4j by neo4j.

the class LatestCheckPointFinderTest method olderLogFileContainingACheckPointAndNewerFileContainingAStart.

@Test
public void olderLogFileContainingACheckPointAndNewerFileContainingAStart() throws Throwable {
    // given
    long txId = 11;
    StartEntry start = start();
    setupLogFiles(logFile(checkPoint()), logFile(start, commit(txId)));
    // when
    LatestCheckPoint latestCheckPoint = finder.find(endLogVersion);
    // then
    assertLatestCheckPoint(true, true, txId, startLogVersion, latestCheckPoint);
}
Also used : LatestCheckPoint(org.neo4j.kernel.recovery.LatestCheckPointFinder.LatestCheckPoint) Test(org.junit.Test)

Example 14 with LatestCheckPoint

use of org.neo4j.kernel.recovery.LatestCheckPointFinder.LatestCheckPoint in project neo4j by neo4j.

the class LatestCheckPointFinderTest method olderLogFileContainingAStartAndNewerFileContainingACheckPointPointingToAPreviousPositionThanStartWithoutCommit.

@Test
public void olderLogFileContainingAStartAndNewerFileContainingACheckPointPointingToAPreviousPositionThanStartWithoutCommit() throws Throwable {
    // given
    StartEntry start = start();
    setupLogFiles(logFile(start), logFile(checkPoint(start)));
    // when
    LatestCheckPoint latestCheckPoint = finder.find(endLogVersion);
    // then
    assertLatestCheckPoint(true, false, NO_TRANSACTION_ID, endLogVersion, latestCheckPoint);
}
Also used : LatestCheckPoint(org.neo4j.kernel.recovery.LatestCheckPointFinder.LatestCheckPoint) Test(org.junit.Test)

Example 15 with LatestCheckPoint

use of org.neo4j.kernel.recovery.LatestCheckPointFinder.LatestCheckPoint in project neo4j by neo4j.

the class LatestCheckPointFinderTest method latestLogFileContainingACheckPointOnly.

@Test
public void latestLogFileContainingACheckPointOnly() throws Throwable {
    // given
    setupLogFiles(logFile(checkPoint()));
    // when
    LatestCheckPoint latestCheckPoint = finder.find(endLogVersion);
    // then
    assertLatestCheckPoint(true, false, NO_TRANSACTION_ID, endLogVersion, latestCheckPoint);
}
Also used : LatestCheckPoint(org.neo4j.kernel.recovery.LatestCheckPointFinder.LatestCheckPoint) Test(org.junit.Test)

Aggregations

LatestCheckPoint (org.neo4j.kernel.recovery.LatestCheckPointFinder.LatestCheckPoint)25 Test (org.junit.Test)24 LogPosition (org.neo4j.kernel.impl.transaction.log.LogPosition)3 IOException (java.io.IOException)1 UnderlyingStorageException (org.neo4j.kernel.impl.store.UnderlyingStorageException)1 Result (org.neo4j.kernel.impl.storemigration.StoreVersionCheck.Result)1 PhysicalLogFiles (org.neo4j.kernel.impl.transaction.log.PhysicalLogFiles)1 ReadableClosablePositionAwareChannel (org.neo4j.kernel.impl.transaction.log.ReadableClosablePositionAwareChannel)1 CheckPoint (org.neo4j.kernel.impl.transaction.log.entry.CheckPoint)1 VersionAwareLogEntryReader (org.neo4j.kernel.impl.transaction.log.entry.VersionAwareLogEntryReader)1 LatestCheckPointFinder (org.neo4j.kernel.recovery.LatestCheckPointFinder)1