Class BlockAccessMem

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

    public class BlockAccessMem
    extends java.lang.Object
    implements BlockAccess
    File access layer that simulates a disk in-memory - for testing, not written for efficiency. There is a safe mode, whereby blocks are copied in and out to guarantee no writing to an unallocated block. This is very inefficient but a better simulation of a disk.
    See Also:
    BlockAccessByteArray
    • Field Detail

      • SafeMode

        public static boolean SafeMode
    • Constructor Detail

      • BlockAccessMem

        public BlockAccessMem​(java.lang.String label,
                              int blockSize)
    • Method Detail

      • resetAllocBoundary

        public void resetAllocBoundary​(long boundary)
        Description copied from interface: BlockAccess
        Reset the allocation space (i.e. truncate). The boundary should be a number obtained from a previous call of allocLimit. It can not be greater than the current allocation boundary.
        Specified by:
        resetAllocBoundary in interface BlockAccess
      • valid

        public boolean valid​(long id)
        Specified by:
        valid in interface BlockAccess
      • close

        public void close()
        Specified by:
        close in interface org.apache.jena.atlas.lib.Closeable
      • sync

        public void sync()
        Specified by:
        sync in interface org.apache.jena.atlas.lib.Sync
      • getLabel

        public java.lang.String getLabel()
        Specified by:
        getLabel in interface BlockAccess
      • toString

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