Search in sources :

Example 1 with JournalFileReader

use of org.apache.jackrabbit.oak.segment.spi.persistence.JournalFileReader in project jackrabbit-oak by apache.

the class AzureJournalFileTest method testSplitJournalFiles.

@Test
public void testSplitJournalFiles() throws IOException {
    assertFalse(journal.exists());
    JournalFileWriter writer = journal.openJournalWriter();
    for (int i = 0; i < 100; i++) {
        writer.writeLine("line " + i);
    }
    assertTrue(journal.exists());
    writer = journal.openJournalWriter();
    for (int i = 100; i < 200; i++) {
        writer.writeLine("line " + i);
    }
    JournalFileReader reader = journal.openJournalReader();
    for (int i = 199; i >= 0; i--) {
        assertEquals("line " + i, reader.readLine());
    }
}
Also used : JournalFileWriter(org.apache.jackrabbit.oak.segment.spi.persistence.JournalFileWriter) JournalFileReader(org.apache.jackrabbit.oak.segment.spi.persistence.JournalFileReader) Test(org.junit.Test)

Aggregations

JournalFileReader (org.apache.jackrabbit.oak.segment.spi.persistence.JournalFileReader)1 JournalFileWriter (org.apache.jackrabbit.oak.segment.spi.persistence.JournalFileWriter)1 Test (org.junit.Test)1