}
@Test
public void api() throws Exception {
// Create journal and configure some settings:
JournalBuilder builder = JournalBuilder.of(JOURNAL_DIR)
.setChecksum(true)
.setMaxFileLength(1024 * 1024)
.setMaxWriteBatchSize(1024 * 10);
// Open the journal:
Journal journal = builder.open();
// Write to the journal:
int iterations = 1000;
for (int i = 0; i < iterations; i++) {
Journal.WriteType writeType = i % 2 == 0 ? Journal.WriteType.SYNC : Journal.WriteType.ASYNC;