Search in sources :

Example 11 with SimpleTriggerInfo

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

the class IndexRecoveryIT method rotateLogsAndCheckPoint.

private void rotateLogsAndCheckPoint() throws IOException {
    db.getDependencyResolver().resolveDependency(LogRotation.class).rotateLogFile();
    db.getDependencyResolver().resolveDependency(CheckPointer.class).forceCheckPoint(new SimpleTriggerInfo("test"));
}
Also used : SimpleTriggerInfo(org.neo4j.kernel.impl.transaction.log.checkpoint.SimpleTriggerInfo) CheckPointer(org.neo4j.kernel.impl.transaction.log.checkpoint.CheckPointer) LogRotation(org.neo4j.kernel.impl.transaction.log.rotation.LogRotation)

Example 12 with SimpleTriggerInfo

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

the class PartialTransactionFailureIT method createRelationship.

private Runnable createRelationship(final EmbeddedGraphDatabase db, final Node x, final Node y, final CountDownLatch latch) {
    return new Runnable() {

        @Override
        public void run() {
            try (Transaction tx = db.beginTx()) {
                x.createRelationshipTo(y, RelationshipType.withName("r"));
                tx.success();
                latch.await();
                db.getDependencyResolver().resolveDependency(LogRotation.class).rotateLogFile();
                db.getDependencyResolver().resolveDependency(CheckPointer.class).forceCheckPoint(new SimpleTriggerInfo("test"));
            } catch (Exception ignore) {
            // We don't care about our transactions failing, as long as we
            // can recover our database to a consistent state.
            }
        }
    };
}
Also used : SimpleTriggerInfo(org.neo4j.kernel.impl.transaction.log.checkpoint.SimpleTriggerInfo) Transaction(org.neo4j.graphdb.Transaction) CheckPointer(org.neo4j.kernel.impl.transaction.log.checkpoint.CheckPointer) LogRotation(org.neo4j.kernel.impl.transaction.log.rotation.LogRotation)

Example 13 with SimpleTriggerInfo

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

the class TestLogPruning method checkPoint.

private void checkPoint() throws IOException {
    TriggerInfo triggerInfo = new SimpleTriggerInfo("test");
    db.getDependencyResolver().resolveDependency(CheckPointer.class).forceCheckPoint(triggerInfo);
}
Also used : SimpleTriggerInfo(org.neo4j.kernel.impl.transaction.log.checkpoint.SimpleTriggerInfo) TriggerInfo(org.neo4j.kernel.impl.transaction.log.checkpoint.TriggerInfo) SimpleTriggerInfo(org.neo4j.kernel.impl.transaction.log.checkpoint.SimpleTriggerInfo) CheckPointer(org.neo4j.kernel.impl.transaction.log.checkpoint.CheckPointer)

Example 14 with SimpleTriggerInfo

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

the class UniqueIndexRecoveryTests method rotateLogAndCheckPoint.

private void rotateLogAndCheckPoint() throws IOException {
    db.getDependencyResolver().resolveDependency(LogRotation.class).rotateLogFile();
    db.getDependencyResolver().resolveDependency(CheckPointer.class).forceCheckPoint(new SimpleTriggerInfo("test"));
}
Also used : SimpleTriggerInfo(org.neo4j.kernel.impl.transaction.log.checkpoint.SimpleTriggerInfo) CheckPointer(org.neo4j.kernel.impl.transaction.log.checkpoint.CheckPointer) LogRotation(org.neo4j.kernel.impl.transaction.log.rotation.LogRotation)

Example 15 with SimpleTriggerInfo

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

the class LuceneIndexRecoveryIT method rotateLogsAndCheckPoint.

private void rotateLogsAndCheckPoint() throws IOException {
    db.getDependencyResolver().resolveDependency(LogRotation.class).rotateLogFile();
    db.getDependencyResolver().resolveDependency(CheckPointer.class).forceCheckPoint(new SimpleTriggerInfo("test"));
}
Also used : SimpleTriggerInfo(org.neo4j.kernel.impl.transaction.log.checkpoint.SimpleTriggerInfo) CheckPointer(org.neo4j.kernel.impl.transaction.log.checkpoint.CheckPointer) LogRotation(org.neo4j.kernel.impl.transaction.log.rotation.LogRotation)

Aggregations

SimpleTriggerInfo (org.neo4j.kernel.impl.transaction.log.checkpoint.SimpleTriggerInfo)15 CheckPointer (org.neo4j.kernel.impl.transaction.log.checkpoint.CheckPointer)14 LogRotation (org.neo4j.kernel.impl.transaction.log.rotation.LogRotation)7 File (java.io.File)4 Test (org.junit.Test)4 Transaction (org.neo4j.graphdb.Transaction)4 GraphDatabaseAPI (org.neo4j.kernel.internal.GraphDatabaseAPI)3 IOException (java.io.IOException)2 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)2 Node (org.neo4j.graphdb.Node)2 Resource (org.neo4j.graphdb.Resource)2 PagedFile (org.neo4j.io.pagecache.PagedFile)2 TriggerInfo (org.neo4j.kernel.impl.transaction.log.checkpoint.TriggerInfo)2 StoreFileMetadata (org.neo4j.storageengine.api.StoreFileMetadata)2 TestGraphDatabaseFactory (org.neo4j.test.TestGraphDatabaseFactory)2 UncheckedIOException (java.io.UncheckedIOException)1 ByteBuffer (java.nio.ByteBuffer)1 ReadableByteChannel (java.nio.channels.ReadableByteChannel)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1