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 Details

    • exists

      public static boolean exists(org.apache.jena.dboe.base.file.Location location)
    • create

      public static Journal create(org.apache.jena.dboe.base.file.BufferChannel chan)
    • create

      public static Journal create(org.apache.jena.dboe.base.file.Location location)
    • 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, 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 Iterator<JournalEntry> entries()
    • entries

      public Iterator<JournalEntry> entries(long startPosition)
    • sync

      public void sync()
      Specified by:
      sync in interface org.apache.jena.atlas.lib.Sync
    • close

      public void close()
      Specified by:
      close in interface org.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 org.apache.jena.dboe.base.file.Location getLocation()
    • getFilename

      public String getFilename()