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 TypeMethodDescriptionvoidclose()org.apache.jena.dboe.base.file.BufferChannelLow level control - for example, used for cloning setup.getState()Return the serialized state using the internal ByteBuffer Typically called by "prepare" for the bytes to write to the journal.voidThe read process : get all bytes on disk, deserializevoidsetState(ByteBuffer buff) Set the in-memory state from a ByteBuffer, for example, from journal recovery.voidsync()voidThe write process : serialize, write, sync, After this, the bytes definitely are on disk, not in some OS cache
-
Method Details
-
getBufferChannel
public org.apache.jena.dboe.base.file.BufferChannel getBufferChannel()Low level control - for example, used for cloning setup. Use with care. -
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
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:
syncin interfaceorg.apache.jena.atlas.lib.Sync
-
close
public void close()- Specified by:
closein interfaceorg.apache.jena.atlas.lib.Closeable
-