Class BlockMgrFileAccess

  • All Implemented Interfaces:
    org.apache.jena.atlas.lib.Closeable, org.apache.jena.atlas.lib.Sync, BlockMgr

    public final class BlockMgrFileAccess
    extends BlockMgrBase
    Block manager that maps from the FileAccess layer to a BlockMgr. Add free block management (but we should layer with BlockMgrFreeChain)
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long allocLimit()
      The fixed allocated blocks are in the range [0,allocLimit).
      void close()
      Close the block manager
      void free​(Block block)
      Announce a block is no longer in use (i.e it's now freed)
      Block getRead​(long id)
      Fetch a block, use for read only
      Block getWrite​(long id)
      Fetch a block, use for write and read - only inside "update"
      boolean isClosed()
      Is this block manager still usable? Closed block managers can not perform any operations except this one.
      boolean isEmpty()
      Answer whether there are any blocks in the collection being managed
      void overwrite​(Block block)
      Replace the contents of a block slot with new contents.
      Block promote​(Block block)
      Promote to writable : it's OK to promote an already writable block
      void release​(Block block)
      Release a block, unmodified or already written.
      void resetAlloc​(long boundary)
      Reset the allocation limit, should be a number previously obtained from allocLimit
      void sync()
      Sync the block manager
      void syncForce()
      Sync the block manager : system operation to ensure sync() is passed down
      java.lang.String toString()  
      boolean valid​(int id)
      Is this a valid block id? (may be a free block)
      void write​(Block block)
      Write a block back - it still needs releasing.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • promote

        public Block promote​(Block block)
        Description copied from interface: BlockMgr
        Promote to writable : it's OK to promote an already writable block
      • getRead

        public Block getRead​(long id)
        Description copied from interface: BlockMgr
        Fetch a block, use for read only
      • getWrite

        public Block getWrite​(long id)
        Description copied from interface: BlockMgr
        Fetch a block, use for write and read - only inside "update"
      • release

        public void release​(Block block)
        Description copied from interface: BlockMgr
        Release a block, unmodified or already written.
      • write

        public void write​(Block block)
        Description copied from interface: BlockMgr
        Write a block back - it still needs releasing.
      • overwrite

        public void overwrite​(Block block)
        Description copied from interface: BlockMgr
        Replace 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: BlockMgr
        Announce a block is no longer in use (i.e it's now freed)
      • valid

        public boolean valid​(int id)
        Description copied from interface: BlockMgr
        Is this a valid block id? (may be a free block)
      • sync

        public void sync()
        Description copied from interface: BlockMgr
        Sync the block manager
      • syncForce

        public void syncForce()
        Description copied from interface: BlockMgr
        Sync the block manager : system operation to ensure sync() is passed down
      • isClosed

        public boolean isClosed()
        Description copied from interface: BlockMgr
        Is this block manager still usable? Closed block managers can not perform any operations except this one.
      • close

        public void close()
        Description copied from interface: BlockMgr
        Close the block manager
      • isEmpty

        public boolean isEmpty()
        Description copied from interface: BlockMgr
        Answer whether there are any blocks in the collection being managed
      • allocLimit

        public long allocLimit()
        Description copied from interface: BlockMgr
        The fixed allocated blocks are in the range [0,allocLimit). Allocation units need not be +1 increments
      • resetAlloc

        public void resetAlloc​(long boundary)
        Description copied from interface: BlockMgr
        Reset the allocation limit, should be a number previously obtained from allocLimit
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object