| java.lang.Object org.openrdf.sail.nativerdf.datastore.IDFile
IDFile | public class IDFile (Code) | | Class supplying access to an ID file. An ID file maps IDs (integers >= 1)
to file pointers (long integers). There is a direct correlation between IDs
and the position at which the file pointers are stored; the file pointer for
ID X is stored at position 8*X.
author: Arjohn Kampman |
Method Summary | |
public void | clear() Discards all stored data. | public void | close() Closes the ID file, releasing any file locks that it might have. | final public File | getFile() | public int | getMaxID() Gets the largest ID that is stored in this ID file. | public long | getOffset(int id) Gets the offset of the data entry with the specified ID.
Parameters: id - The ID to get the offset for, must be larger than 0. | public void | setOffset(int id, long offset) Sets or updates the stored offset for the specified ID. | public int | storeOffset(long offset) Stores the offset of a new data entry, returning the ID under which is
stored. | public void | sync() Syncs any unstored data to the hash file. |
getMaxID | public int getMaxID() throws IOException(Code) | | Gets the largest ID that is stored in this ID file.
The largest ID, or 0 if the file does not contain anydata. throws: IOException - If an I/O error occurs. |
getOffset | public long getOffset(int id) throws IOException(Code) | | Gets the offset of the data entry with the specified ID.
Parameters: id - The ID to get the offset for, must be larger than 0. The offset for the ID. |
setOffset | public void setOffset(int id, long offset) throws IOException(Code) | | Sets or updates the stored offset for the specified ID.
Parameters: id - The ID to set the offset for, must be larger than 0. Parameters: offset - The (new) offset for the specified ID. |
storeOffset | public int storeOffset(long offset) throws IOException(Code) | | Stores the offset of a new data entry, returning the ID under which is
stored.
|
sync | public void sync() throws IOException(Code) | | Syncs any unstored data to the hash file.
|
|
|