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 java.lang.Object implements org.apache.jena.atlas.lib.Sync, org.apache.jena.atlas.lib.CloseableHelper 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()BufferChannelgetBufferChannel()Low level control - for example, used for cloning setup.java.nio.ByteBuffergetState()Return the serialized state using the internal ByteBuffer Typically called by "prepare" for the bytes to write to the journal.voidreadState()The read process : get all bytes on disk, deserializevoidsetState(java.nio.ByteBuffer buff)Set the in-memory state from a ByteBuffer, for example, from journal recovery.voidsync()voidwriteState()The write process : serialize, write, sync, After this, the bytes definitely are on disk, not in some OS cache
-
-
-
Method Detail
-
getBufferChannel
public BufferChannel getBufferChannel()
Low level control - for example, used for cloning setup. Use with care.
-
getState
public java.nio.ByteBuffer getState()
Return the serialized state using the internal ByteBuffer Typically called by "prepare" for the bytes to write to the journal. Callsserialize(java.nio.ByteBuffer). This method does not perform an external I/O.
-
setState
public void setState(java.nio.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 n-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:
syncin interfaceorg.apache.jena.atlas.lib.Sync
-
close
public void close()
- Specified by:
closein interfaceorg.apache.jena.atlas.lib.Closeable
-
-