Package org.apache.jena.dboe.base.file
Class BlockAccessMem
java.lang.Object
org.apache.jena.dboe.base.file.BlockAccessMem
- All Implemented Interfaces:
org.apache.jena.atlas.lib.Closeable,org.apache.jena.atlas.lib.Sync,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:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
SafeMode
public static boolean SafeMode
-
-
Constructor Details
-
BlockAccessMem
-
-
Method Details
-
allocate
- Specified by:
allocatein interfaceBlockAccess
-
read
- Specified by:
readin interfaceBlockAccess
-
write
- Specified by:
writein interfaceBlockAccess
-
overwrite
- Specified by:
overwritein interfaceBlockAccess
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceBlockAccess
-
allocBoundary
public long allocBoundary()- Specified by:
allocBoundaryin interfaceBlockAccess
-
resetAllocBoundary
public void resetAllocBoundary(long boundary) Description copied from interface:BlockAccessReset 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:
resetAllocBoundaryin interfaceBlockAccess
-
valid
public boolean valid(long id) - Specified by:
validin interfaceBlockAccess
-
close
public void close()- Specified by:
closein interfaceorg.apache.jena.atlas.lib.Closeable
-
sync
public void sync()- Specified by:
syncin interfaceorg.apache.jena.atlas.lib.Sync
-
getLabel
- Specified by:
getLabelin interfaceBlockAccess
-
toString
-