|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.obsearch.storage.tc.AbstractTCOBStorage<TupleLong>
net.obsearch.storage.tc.TCOBStorageLong
public final class TCOBStorageLong
BDBOBStoreLong is a wrapper for Berkeley indexes that assumes that keys are longs and values are byte[].
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class net.obsearch.storage.tc.AbstractTCOBStorage |
|---|
AbstractTCOBStorage.ByteArrayIterator, AbstractTCOBStorage.ByteArrayKeyIterator, AbstractTCOBStorage.CursorIterator<T> |
| Field Summary |
|---|
| Fields inherited from class net.obsearch.storage.tc.AbstractTCOBStorage |
|---|
fact, stats |
| Constructor Summary | |
|---|---|
TCOBStorageLong(String name,
tokyocabinet.DBM db,
OBStoreFactory fact,
OBStorageConfig storageConf)
Builds a new Storage system by receiving a Berkeley DB database that uses longs as a primary indexing method. |
|
| Method Summary | |
|---|---|
long |
bytesToValue(byte[] entry)
Converts the value of the given entry into its primitive type. |
OperationStatus |
delete(long key)
Deletes the given key and its corresponding value from the database. |
byte[] |
getValue(long key)
Returns the associated value for the given key. |
byte[] |
prepareBytes(byte[] in)
Transform Bytes in a format that can be used by the underlying index. |
CloseIterator<TupleLong> |
processAll()
Process all the elements in the DB. |
CloseIterator<TupleLong> |
processRange(long low,
long high)
Process the given range of items (from low to high), including low and high. |
CloseIterator<TupleLong> |
processRangeNoDup(long low,
long high)
|
CloseIterator<TupleLong> |
processRangeReverse(long low,
long high)
Process the given range of items (from high to low), including low and high. |
CloseIterator<TupleLong> |
processRangeReverseNoDup(long low,
long high)
|
OperationStatus |
put(long key,
byte[] value)
Inserts the key value pair. |
| Methods inherited from class net.obsearch.storage.tc.AbstractTCOBStorage |
|---|
allowsDuplicatedData, close, delete, deleteAll, getFactory, getName, getReadStats, getStats, getValue, nextId, optimize, processAllKeys, processRange, processRangeNoDup, processRangeReverse, processRangeReverseNoDup, put, putIfNew, setReadStats, size |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.obsearch.storage.OBStore |
|---|
close, delete, deleteAll, getFactory, getName, getReadStats, getStats, getValue, nextId, optimize, processRange, processRangeNoDup, processRangeReverse, processRangeReverseNoDup, put, setReadStats, size |
| Constructor Detail |
|---|
public TCOBStorageLong(String name,
tokyocabinet.DBM db,
OBStoreFactory fact,
OBStorageConfig storageConf)
throws OBStorageException,
OBException
db - The database to be stored.seq - Sequences database.name - Name of the database.
OBException
OBStorageException
com.sleepycat.je.DatabaseException - if something goes wrong with the database.| Method Detail |
|---|
public OperationStatus delete(long key)
throws OBStorageException
OBStoreLong
delete in interface OBStoreLongkey - The key that will be deleted.
net.obsearch.OperationStatus.Status#OK if the key was found,
otherwise, net.obsearch.OperationStatus.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.public long bytesToValue(byte[] entry)
bytesToValue in interface OBStoreLongentry - The place where we will put the entry.
public byte[] getValue(long key)
throws IllegalArgumentException,
OBStorageException
OBStoreLong
getValue in interface OBStoreLongkey - the key that will be searched.
IllegalArgumentException - If the underlying storage system can hold multiple keys.
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.
public OperationStatus put(long key,
byte[] value)
throws IllegalArgumentException,
OBStorageException
OBStoreLong
put in interface OBStoreLongkey - Key to insertvalue - The value that the key will hold after this operation
completes.
net.obsearch.OperationStatus.Status#OK the record
was inserted/updated successfully.
net.obsearch.OperationStatus.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.
IllegalArgumentException
public CloseIterator<TupleLong> processRange(long low,
long high)
OBStoreLong
processRange in interface OBStoreLong
public CloseIterator<TupleLong> processRangeNoDup(long low,
long high)
throws OBStorageException
OBStorageException
public CloseIterator<TupleLong> processRangeReverse(long low,
long high)
throws OBStorageException
OBStoreLong
processRangeReverse in interface OBStoreLongOBStorageException - If an exception occurs at the underlying storage system.
You can query the exception to see more details regarding
the nature of the error.
public CloseIterator<TupleLong> processRangeReverseNoDup(long low,
long high)
throws OBStorageException
OBStorageException
public CloseIterator<TupleLong> processAll()
throws OBStorageException
OBStore
processAll in interface OBStore<TupleLong>OBStorageExceptionpublic byte[] prepareBytes(byte[] in)
OBStore
prepareBytes in interface OBStore<TupleLong>in - Input byte array
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||