Class Journal
java.lang.Object
org.apache.jena.dboe.transaction.txn.journal.Journal
- All Implemented Interfaces:
org.apache.jena.atlas.lib.Closeable,org.apache.jena.atlas.lib.Sync
public final class Journal
extends Object
implements org.apache.jena.atlas.lib.Sync, org.apache.jena.atlas.lib.Closeable
A transaction journal.
The journal is append-only for writes, with truncation of the file
every so often. It is read during recovery.
The size of entries depends on per-component redo/undo records;
the control records like COMMIT are quite small.
Entries have a CRC to ensure that part-entries are not acted on.
-
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclose()voidstatic Journalcreate(BufferChannel chan) static JournalvoidendWrite()entries()entries(long startPosition) static booleanbooleanisEmpty()longposition()readJournal(long id) voidreopen()Forced reopen - Thread.interrupt causes java to close file.voidreset()longsize()voidvoidsync()voidtruncate(long size) longwrite(JournalEntryType type, ComponentId componentId, ByteBuffer buffer) Write an entry and return it's location in the journallongwrite(PrepareState prepareState) longwriteJournal(JournalEntry entry) long
-
Method Details
-
exists
-
create
-
create
-
reopen
public void reopen()Forced reopen - Thread.interrupt causes java to close file. Attempt to close, open, and position. -
writeJournal
-
write
-
write
Write an entry and return it's location in the journal -
readJournal
-
startWrite
public void startWrite() -
writeStartPosn
public long writeStartPosn() -
commitWrite
public void commitWrite() -
abortWrite
public void abortWrite() -
endWrite
public void endWrite() -
entries
-
entries
-
sync
public void sync()- Specified by:
syncin interfaceorg.apache.jena.atlas.lib.Sync
-
close
public void close()- Specified by:
closein interfaceorg.apache.jena.atlas.lib.Closeable
-
size
public long size() -
isEmpty
public boolean isEmpty() -
truncate
public void truncate(long size) -
reset
public void reset() -
position
public long position() -
getLocation
-
getFilename
-