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 java.lang.Object implements org.apache.jena.atlas.lib.Sync, org.apache.jena.atlas.lib.CloseableA 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabortWrite()voidclose()voidcommitWrite()static Journalcreate(BufferChannel chan)static Journalcreate(Location location)voidendWrite()java.util.Iterator<JournalEntry>entries()java.util.Iterator<JournalEntry>entries(long startPosition)static booleanexists(Location location)java.lang.StringgetFilename()LocationgetLocation()booleanisEmpty()longposition()JournalEntryreadJournal(long id)voidreopen()Forced reopen - Thread.interrupt causes java to close file.voidreset()longsize()voidstartWrite()voidsync()voidtruncate(long size)longwrite(JournalEntryType type, ComponentId componentId, java.nio.ByteBuffer buffer)Write an entry and return it's location in the journallongwrite(PrepareState prepareState)longwriteJournal(JournalEntry entry)longwriteStartPosn()
-
-
-
Method Detail
-
exists
public static boolean exists(Location location)
-
create
public static Journal create(BufferChannel chan)
-
reopen
public void reopen()
Forced reopen - Thread.interrupt causes java to close file. Attempt to close, open, and position.
-
writeJournal
public long writeJournal(JournalEntry entry)
-
write
public long write(PrepareState prepareState)
-
write
public long write(JournalEntryType type, ComponentId componentId, java.nio.ByteBuffer buffer)
Write an entry and return it's location in the journal
-
readJournal
public JournalEntry readJournal(long id)
-
startWrite
public void startWrite()
-
writeStartPosn
public long writeStartPosn()
-
commitWrite
public void commitWrite()
-
abortWrite
public void abortWrite()
-
endWrite
public void endWrite()
-
entries
public java.util.Iterator<JournalEntry> entries()
-
entries
public java.util.Iterator<JournalEntry> entries(long startPosition)
-
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
public Location getLocation()
-
getFilename
public java.lang.String getFilename()
-
-