Class Journal

java.lang.Object
org.apache.jena.tdb1.transaction.Journal
All Implemented Interfaces:
org.apache.jena.atlas.lib.Closeable

public final class Journal extends Object implements org.apache.jena.atlas.lib.Closeable
The Journal is slightly odd - it is append-only for write but random read. The write performance is more important than read; reads only happen if the journal grows to the point where it needs to free up cache.
  • Constructor Details

  • Method Details

    • exists

      public static boolean exists(Location location)
    • create

      public static Journal create(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(JournalEntryType type, FileRef fileRef, Block block)
    • readJournal

      public JournalEntry readJournal(long id)
    • entries

      public Iterator<JournalEntry> entries()
    • entries

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

      public void startWrite()
       journal.startWrite();
       try {
               journal.write
               journal.commitWrite();
       } catch (Thowable ex) { journal.abortWrite(); }
       finally { journal.endWrite(); }
       
    • writeStartPosn

      public long writeStartPosn()
    • commitWrite

      public void commitWrite()
    • abortWrite

      public void abortWrite()
    • endWrite

      public void endWrite()
    • sync

      public void 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)
    • append

      public void append()
    • position

      public long position()
    • position

      public void position(long posn)
    • getFilename

      public String getFilename()