|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openrdf.sail.nativerdf.datastore.IDFile
public class IDFile
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.
| Constructor Summary | |
|---|---|
IDFile(File file)
|
|
IDFile(File file,
boolean forceSync)
|
|
| Method Summary | |
|---|---|
void |
clear()
Discards all stored data. |
void |
close()
Closes the ID file, releasing any file locks that it might have. |
File |
getFile()
|
int |
getMaxID()
Gets the largest ID that is stored in this ID file. |
long |
getOffset(int id)
Gets the offset of the data entry with the specified ID. |
void |
setOffset(int id,
long offset)
Sets or updates the stored offset for the specified ID. |
int |
storeOffset(long offset)
Stores the offset of a new data entry, returning the ID under which is stored. |
void |
sync()
Syncs any unstored data to the hash file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IDFile(File file)
throws IOException
IOException
public IDFile(File file,
boolean forceSync)
throws IOException
IOException| Method Detail |
|---|
public final File getFile()
public int getMaxID()
throws IOException
IOException - If an I/O error occurs.
public int storeOffset(long offset)
throws IOException
IOException
public void setOffset(int id,
long offset)
throws IOException
id - The ID to set the offset for, must be larger than 0.offset - The (new) offset for the specified ID.
IOException
public long getOffset(int id)
throws IOException
id - The ID to get the offset for, must be larger than 0.
IOException
public void clear()
throws IOException
IOException - If an I/O error occurred.
public void sync()
throws IOException
IOException
public void close()
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||