Package org.apache.jena.dboe.base.block
Class BlockMgrSync
- java.lang.Object
-
- org.apache.jena.dboe.base.block.BlockMgrSync
-
- All Implemented Interfaces:
org.apache.jena.atlas.lib.Closeable,org.apache.jena.atlas.lib.Sync,BlockMgr
- Direct Known Subclasses:
BlockMgrCache
public class BlockMgrSync extends java.lang.Object implements BlockMgr
Add synchronized to a BlockMgr. This is the same as BlockMgrWrapper but with 'synchronized' added
-
-
Constructor Summary
Constructors Constructor Description BlockMgrSync(BlockMgr blockMgr)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Blockallocate(int blockSize)Allocate an uninitialized block - writable - call only inside a update sequence.longallocLimit()The fixed allocated blocks are in the range [0,allocLimit).voidbeginRead()Start of readvoidbeginUpdate()Start of updatevoidclose()Close the block managervoidendRead()Completion of readvoidendUpdate()Completion of updatevoidfree(Block block)Announce a block is no longer in use (i.e it's now freed)java.lang.StringgetLabel()BlockgetRead(long id)Fetch a block, use for read onlyBlockMgrgetWrapped()BlockgetWrite(long id)Fetch a block, use for write and read - only inside "update"booleanisClosed()Is this block manager still usable? Closed block managers can not perform any operations except this one.booleanisEmpty()Answer whether there are any blocks in the collection being managedvoidoverwrite(Block block)Replace the contents of a block slot with new contents.Blockpromote(Block block)Promote to writable : it's OK to promote an already writable blockvoidrelease(Block block)Release a block, unmodified or already written.voidresetAlloc(long boundary)Reset the allocation limit, should be a number previously obtained from allocLimitvoidsync()Sync the block managervoidsyncForce()Sync the block manager : system operation to ensure sync() is passed downjava.lang.StringtoString()booleanvalid(int id)Is this a valid block id? (may be a free block)voidwrite(Block block)Write a block back - it still needs releasing.
-
-
-
Constructor Detail
-
BlockMgrSync
public BlockMgrSync(BlockMgr blockMgr)
-
-
Method Detail
-
getWrapped
public BlockMgr getWrapped()
-
allocate
public Block allocate(int blockSize)
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
public Block getRead(long id)
Description copied from interface:BlockMgrFetch a block, use for read only
-
getWrite
public Block getWrite(long id)
Description copied from interface:BlockMgrFetch a block, use for write and read - only inside "update"
-
promote
public Block promote(Block block)
Description copied from interface:BlockMgrPromote to writable : it's OK to promote an already writable block
-
release
public void release(Block block)
Description copied from interface:BlockMgrRelease a block, unmodified or already written.
-
write
public void write(Block block)
Description copied from interface:BlockMgrWrite a block back - it still needs releasing.
-
overwrite
public void overwrite(Block block)
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
public void free(Block block)
Description copied from interface:BlockMgrAnnounce a block is no longer in use (i.e it's now freed)
-
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
-
close
public void close()
Description copied from interface:BlockMgrClose the block manager
-
isEmpty
public boolean isEmpty()
Description copied from interface:BlockMgrAnswer whether there are any blocks in the collection being managed
-
allocLimit
public long allocLimit()
Description copied from interface:BlockMgrThe fixed allocated blocks are in the range [0,allocLimit). Allocation units need not be +1 increments- Specified by:
allocLimitin interfaceBlockMgr
-
resetAlloc
public void resetAlloc(long boundary)
Description copied from interface:BlockMgrReset the allocation limit, should be a number previously obtained from allocLimit- Specified by:
resetAllocin interfaceBlockMgr
-
beginRead
public void beginRead()
Description copied from interface:BlockMgrStart of read
-
endRead
public void endRead()
Description copied from interface:BlockMgrCompletion of read
-
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
-
valid
public boolean valid(int id)
Description copied from interface:BlockMgrIs this a valid block id? (may be a free block)
-
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.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-