|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface OBStore<T extends Tuple>
OBStore abstracts a generic storage system. The purpose of this class is to allow OBSearch to run on top of different storage systems (distributed, local, file system based, etc). The keys can be sorted, and range queries are possible. The base interface only allows operations on keys of arrays of bytes. Subclasses of this interface will provide specialized methods for Java's primitive types.
Method Summary | |
---|---|
void |
close()
Closes the storage system. |
OperationStatus |
delete(byte[] key)
Deletes the given key and its corresponding value from the database. |
void |
deleteAll()
Deletes all the items in the storage system. |
OBStoreFactory |
getFactory()
Return the factory associated to this storage device. |
String |
getName()
Get the name of this storage system. |
hep.aida.bin.StaticBin1D |
getReadStats()
Returns the read stats, it contains the avg # of bytes read the std deviation and also the number of reads. |
Object |
getStats()
Return the stats of this object (to be printed for the user) |
byte[] |
getValue(byte[] key)
Returns the associated value for the given key. |
long |
nextId()
Returns the next id from the database (incrementing sequences). |
void |
optimize()
Somehow optimizes the underlying storage representation. |
byte[] |
prepareBytes(byte[] in)
Transform Bytes in a format that can be used by the underlying index. |
CloseIterator<T> |
processAll()
Process all the elements in the DB. |
CloseIterator<TupleBytes> |
processRange(byte[] low,
byte[] high)
Process the given range of items (from low to high), including low and high. |
CloseIterator<TupleBytes> |
processRangeNoDup(byte[] low,
byte[] high)
Process the given range of items (from low to high), including low and high. |
CloseIterator<TupleBytes> |
processRangeReverse(byte[] low,
byte[] high)
Process the given range of items (from high to low), including low and high. |
CloseIterator<TupleBytes> |
processRangeReverseNoDup(byte[] low,
byte[] high)
Process the given range of items (from high to low), including low and high. |
OperationStatus |
put(byte[] key,
byte[] value)
Inserts the key value pair. |
void |
setReadStats(hep.aida.bin.StaticBin1D stats)
Sets the stats object to the given stats. |
long |
size()
Returns the number of elements in the database. |
Method Detail |
---|
String getName()
byte[] getValue(byte[] key) throws IllegalArgumentException, OBStorageException, OBException
key
- The key that will be searched.
IllegalArgumentException
- If the underlying storage system can hold multiple keys (
#allowsDuplicatedData()
== true).
OBStorageException
- If an exception occurs at the underlying storage system. You
can query the exception to see more details regarding the
nature of the error.
OBException
IOException
OperationStatus put(byte[] key, byte[] value) throws OBStorageException, OBException
key
- Key to insertvalue
- The value that the key will hold after this operation
completes.
Status.OK
the record was inserted/updated
successfully. Status.ERROR
if the record
could not be updated.
OBStorageException
- If an exception occurs at the underlying storage system. You
can query the exception to see more details regarding the
nature of the error.
OBException
OperationStatus delete(byte[] key) throws OBStorageException, IOException, OBException
key
- The key that will be deleted.
Status.OK
if the key was found, otherwise,
Status.NOT_EXISTS
.
OBStorageException
- If an exception occurs at the underlying storage system. You
can query the exception to see more details regarding the
nature of the error.
OBException
IOException
IllegalAccessException
InstantiationException
OBException
OutOfRangeException
void close() throws OBStorageException
OBStorageException
- If an exception occurs at the underlying storage system. You
can query the exception to see more details regarding the
nature of the error.
OBException
OBException
void deleteAll() throws OBStorageException
OBStorageException
- If an exception occurs at the underlying storage system. You
can query the exception to see more details regarding the
nature of the error.
IllegalAccessException
InstantiationException
OBException
OutOfRangeException
long size() throws OBStorageException
OBStorageException
- If an exception occurs at the underlying storage system. You
can query the exception to see more details regarding the
nature of the error.
OBException
long nextId() throws OBStorageException
OBStorageException
hep.aida.bin.StaticBin1D getReadStats()
void setReadStats(hep.aida.bin.StaticBin1D stats)
Object getStats() throws OBException
OBException
CloseIterator<TupleBytes> processRange(byte[] low, byte[] high) throws OBStorageException
low
- lowest key value to return.high
- highest key value to return.
OBStorageException
- If an exception occurs at the underlying storage system. You
can query the exception to see more details regarding the
nature of the error.CloseIterator<TupleBytes> processRangeNoDup(byte[] low, byte[] high) throws OBStorageException
low
- lowest key value to return.high
- highest key value to return.
OBStorageException
- If an exception occurs at the underlying storage system. You
can query the exception to see more details regarding the
nature of the error.CloseIterator<TupleBytes> processRangeReverse(byte[] low, byte[] high) throws OBStorageException
low
- lowest key value to return.high
- highest key value to return.
OBStorageException
- If an exception occurs at the underlying storage system. You
can query the exception to see more details regarding the
nature of the error.CloseIterator<TupleBytes> processRangeReverseNoDup(byte[] low, byte[] high) throws OBStorageException
low
- lowest key value to return.high
- highest key value to return.
OBStorageException
- If an exception occurs at the underlying storage system. You
can query the exception to see more details regarding the
nature of the error.CloseIterator<T> processAll() throws OBStorageException, OBException
OBStorageException
OBException
OBStoreFactory getFactory()
byte[] prepareBytes(byte[] in)
in
- Input byte array
void optimize() throws OBStorageException
OBStorageException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |