java.lang.Object
org.apache.jena.tdb1.transaction.ObjectFileTransComplex
- All Implemented Interfaces:
org.apache.jena.atlas.lib.Closeable,org.apache.jena.atlas.lib.Sync,ObjectFile,TransactionLifecycle
This version works with two files - the main, base file and a per-transaction journal
file. It writes to the journal side.
To flush, it writes the journal to the base file.
It is relatively untested. This is not the normal implementation of a transactional
ObjectFile.
- See Also:
-
ObjectFileTrans
-
Field Summary
Fields inherited from interface org.apache.jena.tdb1.base.objectfile.ObjectFile
type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidabort(Transaction txn) End of active phase - will not be making these changes.Iterator<org.apache.jena.atlas.lib.Pair<Long,ByteBuffer>> all()All the contents as ByteBuffers - debugging aidvoidbegin(Transaction txn) Start an update transactionvoidAll done - transaction committed and incorporated in the base dataset - can now tidy up - called during journal flush if commiting.voidclose()voidcommitPrepare(Transaction txn) Prepare to commit; end of active phase.voidcommitted(Transaction txn) The commit has happenedvoidUpdate the base data - called during journal flush.getLabel()A label to identify this ObjectFilebooleanisEmpty()Any objects in this file?longlength()Length, in units used by read/write for idsread(long id) Read a buffer at the accessor number.voidreposition(long id) Reset the "append" point; may only be moved earlier.voidsync()voidtruncate(long id) Truncate the filelongwrite(ByteBuffer buffer) Write out the buffer - return the accessor number
-
Constructor Details
-
ObjectFileTransComplex
-
-
Method Details
-
begin
Description copied from interface:TransactionLifecycleStart an update transaction- Specified by:
beginin interfaceTransactionLifecycle
-
commitPrepare
Description copied from interface:TransactionLifecyclePrepare to commit; end of active phase. Make changes safe; do not update the base data.- Specified by:
commitPreparein interfaceTransactionLifecycle
-
committed
Description copied from interface:TransactionLifecycleThe commit has happened- Specified by:
committedin interfaceTransactionLifecycle
-
enactCommitted
Description copied from interface:TransactionLifecycleUpdate the base data - called during journal flush.- Specified by:
enactCommittedin interfaceTransactionLifecycle
-
clearupCommitted
Description copied from interface:TransactionLifecycleAll done - transaction committed and incorporated in the base dataset - can now tidy up - called during journal flush if commiting.- Specified by:
clearupCommittedin interfaceTransactionLifecycle
-
abort
Description copied from interface:TransactionLifecycleEnd of active phase - will not be making these changes.- Specified by:
abortin interfaceTransactionLifecycle
-
reposition
public void reposition(long id) Description copied from interface:ObjectFileReset the "append" point; may only be moved earlier. The new position must correspond to a position returned byObjectFile.write(ByteBuffer).- Specified by:
repositionin interfaceObjectFile
-
truncate
public void truncate(long id) Description copied from interface:ObjectFileTruncate the file- Specified by:
truncatein interfaceObjectFile
-
write
Description copied from interface:ObjectFileWrite out the buffer - return the accessor number- Specified by:
writein interfaceObjectFile
-
read
Description copied from interface:ObjectFileRead a buffer at the accessor number.- Specified by:
readin interfaceObjectFile
-
length
public long length()Description copied from interface:ObjectFileLength, in units used by read/write for ids- Specified by:
lengthin interfaceObjectFile
-
isEmpty
public boolean isEmpty()Description copied from interface:ObjectFileAny objects in this file?- Specified by:
isEmptyin interfaceObjectFile
-
all
Description copied from interface:ObjectFileAll the contents as ByteBuffers - debugging aid- Specified by:
allin interfaceObjectFile
-
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
-
getLabel
Description copied from interface:ObjectFileA label to identify this ObjectFile- Specified by:
getLabelin interfaceObjectFile
-