Field Summary |
|
final protected static long | BIN_AREA_OFFSET The offset into the file that the bin area starts. |
final protected static int | BIN_ENTRIES |
final protected static long | DATA_AREA_OFFSET The offset into the file that the data areas start. |
final protected static long | FIXED_AREA_OFFSET The offset into the file of the 64 byte fixed area. |
final protected static int | MAGIC The magic value. |
protected long[] | free_bin_list The free bin list contains 128 entries pointing to the first available
block in the bin. |
final protected byte[] | header_buf |
protected boolean | read_only True if this is read-only. |
protected long | total_allocated_space The total amount of allocated space within this store since the store
was openned. |
protected long | wilderness_pointer A pointer to the wilderness area (the last deleted area in the store),
or -1 if there is no wilderness area. |
Method Summary |
|
protected void | checkPointer(long pointer) Checks the pointer is valid. |
public synchronized void | close() Closes the store. |
protected void | coalescArea(long pointer, long size) Coalesc one or more areas into a larger area. |
public synchronized AreaWriter | createArea(long size) |
public synchronized void | deleteArea(long id) |
abstract protected long | endOfDataAreaPointer() Returns a pointer to the end of the current data area. |
protected long | expandDataArea(long minimum_size) Expands the data area by at least the minimum size given. |
public ArrayList | findAllocatedAreasNotIn(ArrayList list) Scans the area list, and any areas that aren't deleted and aren't found
in the given ArrayList are returned as leaked areas. |
public List | getAllAreas() Returns a List of Long objects that contain a complete list of all areas
in the store. |
public Area | getArea(long id) |
protected void | getAreaHeader(long pointer, long[] header) Sets the 'header' array with information from the header of the given
pointer. |
public InputStream | getAreaInputStream(long id) |
public MutableArea | getMutableArea(long id) |
protected long | getNextAreaHeader(long pointer, long[] header) Sets the 'header' array with information from the next header to the
given pointer, and returns a pointer to the next area. |
protected long | getPreviousAreaHeader(long pointer, long[] header) Sets the 'header' array with information from the previous header to the
given pointer, and returns a pointer to the previous area. |
abstract protected void | internalClose() Internally closes the backing area. |
abstract protected void | internalOpen(boolean read_only) Internally opens the backing area. |
protected static boolean | isValidBoundarySize(long size) Returns true if the given area size is valid. |
public boolean | lastCloseClean() |
public synchronized boolean | open() Opens the data store. |
public synchronized void | openScanAndFix(UserTerminal terminal) Opens/scans the store looking for any errors with the layout. |
protected void | readBins() Reads the bins from the header information in the file. |
abstract protected int | readByteArrayFrom(long position, byte[] buf, int off, int len) Reads a byte array from the given position in the file. |
abstract protected int | readByteFrom(long position) Reads a byte from the given position in the file. |
protected void | reboundArea(long pointer, long[] header, boolean write_headers) Rebounds the given area with the given header information. |
abstract protected void | setDataAreaSize(long length) Sets the size of the data area. |
protected void | splitArea(long pointer, long new_boundary) Splits an area pointed to by 'pointer' at a new boundary point. |
public synchronized void | statsScan(HashMap properties) Performs an extensive lookup on all the tables in this store and sets a
number of properties in the given HashMap
(property name(String) -> property description(Object)). |
public synchronized long | totalAllocatedSinceStart() Returns the total allocated space since the file was openned. |
protected void | writeAllBins() Updates all bins to the data area header area. |
protected void | writeBinIndex(int index) Updates the given bin index to the data area header area. |
abstract protected void | writeByteArrayTo(long position, byte[] buf, int off, int len) Writes a byte array to the given position in the file. |
abstract protected void | writeByteTo(long position, int b) Writes a byte to the given position in the file. |