| java.lang.Object org.openrdf.sail.nativerdf.datastore.DataStore
DataStore | public class DataStore (Code) | | Class that provides indexed storage and retrieval of arbitrary length data.
author: Arjohn Kampman |
Method Summary | |
public void | clear() Removes all values from the DataStore. | public void | close() Closes the DataStore, releasing any file references, etc. | public byte[] | getData(int id) Gets the value for the specified ID.
Parameters: id - A value ID, should be larger than 0. | public int | getID(byte[] queryData) Gets the ID for the specified value.
Parameters: queryData - The value to get the ID for, must not be null. | public int | getMaxID() Returns the maximum value-ID that is in use. | public static void | main(String[] args) | public int | storeData(byte[] data) Stores the supplied value and returns the ID that has been assigned to it.
In case the data to store is already present, the ID of this existing data
is returned.
Parameters: data - The data to store, must not be null. | public void | sync() Synchronizes any recent changes to the data to disk. |
close | public void close() throws IOException(Code) | | Closes the DataStore, releasing any file references, etc. In case a
transaction is currently open, it will be rolled back. Once closed, the
DataStore can no longer be used.
exception: IOException - If an I/O error occurred. |
getData | public byte[] getData(int id) throws IOException(Code) | | Gets the value for the specified ID.
Parameters: id - A value ID, should be larger than 0. The value for the ID, or null if no such value could befound. exception: IOException - If an I/O error occurred. |
getID | public int getID(byte[] queryData) throws IOException(Code) | | Gets the ID for the specified value.
Parameters: queryData - The value to get the ID for, must not be null. The ID for the specified value, or -1 if no such IDcould be found. exception: IOException - If an I/O error occurred. |
getMaxID | public int getMaxID() throws IOException(Code) | | Returns the maximum value-ID that is in use.
The largest ID, or 0 if the store does not contain anyvalues. throws: IOException - If an I/O error occurs. |
storeData | public int storeData(byte[] data) throws IOException(Code) | | Stores the supplied value and returns the ID that has been assigned to it.
In case the data to store is already present, the ID of this existing data
is returned.
Parameters: data - The data to store, must not be null. The ID that has been assigned to the value. exception: IOException - If an I/O error occurred. |
sync | public void sync() throws IOException(Code) | | Synchronizes any recent changes to the data to disk.
exception: IOException - If an I/O error occurred. |
|
|