Class StateMgrBase

java.lang.Object
org.apache.jena.dboe.transaction.txn.StateMgrBase
All Implemented Interfaces:
org.apache.jena.atlas.lib.Closeable, org.apache.jena.atlas.lib.Sync
Direct Known Subclasses:
StateMgrData

public abstract class StateMgrBase extends Object implements org.apache.jena.atlas.lib.Sync, org.apache.jena.atlas.lib.Closeable
Helper class for the manage the persistent state of a transactional. The persistent state is assumed to be a fixed size, or at least of known maximum size. May not be suitable for all transactional component implementations.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    Low level control - for example, used for cloning setup.
    Return the serialized state using the internal ByteBuffer Typically called by "prepare" for the bytes to write to the journal.
    void
    The read process : get all bytes on disk, deserialize
    void
    Set the in-memory state from a ByteBuffer, for example, from journal recovery.
    void
     
    void
    The write process : serialize, write, sync, After this, the bytes definitely are on disk, not in some OS cache

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getBufferChannel

      public BufferChannel getBufferChannel()
      Low level control - for example, used for cloning setup. Use with care.
    • getState

      public ByteBuffer getState()
      Return the serialized state using the internal ByteBuffer Typically called by "prepare" for the bytes to write to the journal. Calls serialize(java.nio.ByteBuffer). This method does not perform an external I/O.
    • setState

      public void setState(ByteBuffer buff)
      Set the in-memory state from a ByteBuffer, for example, from journal recovery. This method does not perform an external I/O. Call "writeState" to put the memory state as the disk state.
    • writeState

      public void writeState()
      The write process : serialize, write, sync, After this, the bytes definitely are on disk, not in some OS cache
    • readState

      public void readState()
      The read process : get all bytes on disk, deserialize
    • 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