Search in sources :

Example 1 with LatestCheckPoint

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

the class LatestCheckPointFinderTest method twoLogFilesNoCheckPoints.

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

Example 2 with LatestCheckPoint

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

the class LatestCheckPointFinderTest method twoLogFilesCheckPointTargetsPrevious.

@Test
public void twoLogFilesCheckPointTargetsPrevious() throws Exception {
    // given
    long txId = 6;
    PositionEntry position = position();
    setupLogFiles(logFile(start(), commit(txId - 1), position), logFile(start(), commit(txId)), logFile(checkPoint(position)));
    // 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 3 with LatestCheckPoint

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

the class LatestCheckPointFinderTest method oneLogFileNoCheckPoints.

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

Example 4 with LatestCheckPoint

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

the class LatestCheckPointFinderTest method twoLogFilesNoCheckPointsTwoCommits.

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

Example 5 with LatestCheckPoint

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

the class LatestCheckPointFinderTest method oneLogFileNoCheckPointsOneStart.

@Test
public void oneLogFileNoCheckPointsOneStart() throws Throwable {
    // given
    int logVersion = endLogVersion;
    long txId = 10;
    setupLogFiles(logFile(start(), commit(txId)));
    // when
    LatestCheckPoint latestCheckPoint = finder.find(logVersion);
    // then
    assertLatestCheckPoint(false, true, txId, logVersion, latestCheckPoint);
}
Also used : LatestCheckPoint(org.neo4j.kernel.recovery.LatestCheckPointFinder.LatestCheckPoint) 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