Search in sources :

Example 6 with PhysicalLogFileInformation

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

the class PhysicalLogFileInformationTest method shouldReadFirstCommittedTransactionIdForAGivenVersionWhenCached.

@Test
public void shouldReadFirstCommittedTransactionIdForAGivenVersionWhenCached() throws Exception {
    PhysicalLogFileInformation info = new PhysicalLogFileInformation(logFiles, logHeaderCache, transactionIdStore::getLastCommittedTransactionId, logVersionToTimestamp);
    long expected = 5;
    long version = 10L;
    when(logHeaderCache.getLogHeader(version)).thenReturn(expected - 1);
    long firstCommittedTxId = info.getFirstEntryId(version);
    assertEquals(expected, firstCommittedTxId);
}
Also used : PhysicalLogFileInformation(org.neo4j.kernel.impl.transaction.log.PhysicalLogFileInformation) Test(org.junit.Test)

Aggregations

PhysicalLogFileInformation (org.neo4j.kernel.impl.transaction.log.PhysicalLogFileInformation)6 Test (org.junit.Test)5 LogHeader (org.neo4j.kernel.impl.transaction.log.entry.LogHeader)3 File (java.io.File)1 IOException (java.io.IOException)1 Clock (java.time.Clock)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 TimeUnit (java.util.concurrent.TimeUnit)1 LockSupport (java.util.concurrent.locks.LockSupport)1 Supplier (java.util.function.Supplier)1 DependencyResolver (org.neo4j.graphdb.DependencyResolver)1 ResourceIterator (org.neo4j.graphdb.ResourceIterator)1 Setting (org.neo4j.graphdb.config.Setting)1 GraphDatabaseSettings (org.neo4j.graphdb.factory.GraphDatabaseSettings)1 Exceptions (org.neo4j.helpers.Exceptions)1 MapUtil.stringMap (org.neo4j.helpers.collection.MapUtil.stringMap)1 FileSystemAbstraction (org.neo4j.io.fs.FileSystemAbstraction)1 IOLimiter (org.neo4j.io.pagecache.IOLimiter)1 PageCache (org.neo4j.io.pagecache.PageCache)1