java.lang.Object
org.apache.jena.tdb1.transaction.BlockMgrJournal
- All Implemented Interfaces:
org.apache.jena.atlas.lib.Closeable,org.apache.jena.atlas.lib.Sync,BlockMgr,TransactionLifecycle
Block manager that keeps temporary copies of updated blocks, then writes them
to a journal when commitPrepare happens. No work is done in commitEnact
because the
TransactionManager is responsible to writing
the blocks to the main storage.-
Constructor Summary
ConstructorsConstructorDescriptionBlockMgrJournal(Transaction txn, FileRef fileRef, BlockMgr underlyingBlockMgr) -
Method Summary
Modifier and TypeMethodDescriptionvoidabort(Transaction txn) End of active phase - will not be making these changes.allocate(int blockSize) Allocate an uninitialized block - writable - call only inside a update sequence.voidbegin(Transaction txn) Start an update transactionvoidbeginIterator(Iterator<?> iterator) Start of iteratorvoidStart of readvoidStart of updatevoidAll done - transaction committed and incorporated in the base dataset - can now tidy up - called during journal flush if commiting.voidclose()Close the block managervoidcommitPrepare(Transaction txn) Prepare to commit; end of active phase.voidcommitted(Transaction txn) The commit has happenedvoidUpdate the base data - called during journal flush.voidendIterator(Iterator<?> iterator) Completion of iteratorvoidendRead()Completion of readvoidCompletion of updatevoidAnnounce a block is no longer in use (i.e it's now freed)getLabel()getRead(long id) Fetch a block, use for read onlygetReadIterator(long id) Fetch a block, use for read only in an iteratorgetWrite(long id) Fetch a block, use for write and read - only inside "update"booleanisClosed()Is this block manager still usable?booleanisEmpty()Answer whether there are any blocks in the collection being managedvoidReplace the contents of a block slot with new contents.Promote to writeable : it's OK to promote an already writeable blockvoidRelease a block, unmodified.voidsync()Sync the block managervoidSync the block manager : system operation to ensure sync() is passed downtoString()booleanvalid(int id) Is this a valid block id?voidWrite a block back - it still needs releasing.
-
Constructor Details
-
BlockMgrJournal
-
-
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
-
allocate
Description copied from interface:BlockMgrAllocate an uninitialized block - writable - call only inside a update sequence. If blockSize is -1, means "default/fixed size" for this BlockMgr -
getRead
Description copied from interface:BlockMgrFetch a block, use for read only -
getReadIterator
Description copied from interface:BlockMgrFetch a block, use for read only in an iterator- Specified by:
getReadIteratorin interfaceBlockMgr
-
getWrite
Description copied from interface:BlockMgrFetch a block, use for write and read - only inside "update" -
promote
Description copied from interface:BlockMgrPromote to writeable : it's OK to promote an already writeable block -
release
Description copied from interface:BlockMgrRelease a block, unmodified. -
write
Description copied from interface:BlockMgrWrite a block back - it still needs releasing. -
overwrite
Description copied from interface:BlockMgrReplace the contents of a block slot with new contents. Block does not need releasing. The write() operation may not do real work if the block is mapped - this operation really does replace the contents with the new contents. -
free
Description copied from interface:BlockMgrAnnounce a block is no longer in use (i.e it's now freed) -
isEmpty
public boolean isEmpty()Description copied from interface:BlockMgrAnswer whether there are any blocks in the collection being managed -
valid
public boolean valid(int id) Description copied from interface:BlockMgrIs this a valid block id? (may be a free block) -
close
public void close()Description copied from interface:BlockMgrClose the block manager -
isClosed
public boolean isClosed()Description copied from interface:BlockMgrIs this block manager still usable? Closed block managers can not perform any operations except this one. -
sync
public void sync()Description copied from interface:BlockMgrSync the block manager -
syncForce
public void syncForce()Description copied from interface:BlockMgrSync the block manager : system operation to ensure sync() is passed down -
beginUpdate
public void beginUpdate()Description copied from interface:BlockMgrStart of update- Specified by:
beginUpdatein interfaceBlockMgr
-
endUpdate
public void endUpdate()Description copied from interface:BlockMgrCompletion of update -
beginRead
public void beginRead()Description copied from interface:BlockMgrStart of read -
endRead
public void endRead()Description copied from interface:BlockMgrCompletion of read -
beginIterator
Description copied from interface:BlockMgrStart of iterator- Specified by:
beginIteratorin interfaceBlockMgr
-
endIterator
Description copied from interface:BlockMgrCompletion of iterator- Specified by:
endIteratorin interfaceBlockMgr
-
toString
-
getLabel
-