|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.obsearch.index.AbstractOBIndex<O>
net.obsearch.index.pivot.AbstractPivotOBIndex<O>
net.obsearch.index.bucket.AbstractBucketIndex<O,B,Q,BC>
public abstract class AbstractBucketIndex<O extends OB,B extends BucketObject,Q,BC extends BucketContainer<O,B,Q>>
Nested Class Summary | |
---|---|
protected class |
AbstractBucketIndex.BucketIterator
|
Field Summary | |
---|---|
protected OBStore<TupleBytes> |
Buckets
We store the buckets in this storage device. |
Fields inherited from class net.obsearch.index.pivot.AbstractPivotOBIndex |
---|
intrinsicDimensionalityPairs, pivots, pivotSelector |
Fields inherited from class net.obsearch.index.AbstractOBIndex |
---|
A, fact, isFrozen, stats, type |
Fields inherited from interface net.obsearch.Index |
---|
ID_SIZE |
Constructor Summary | |
---|---|
AbstractBucketIndex()
|
|
AbstractBucketIndex(Class<O> type,
IncrementalPivotSelector<O> pivotSelector,
int pivotCount)
|
Method Summary | |
---|---|
protected void |
bucketStats()
|
void |
close()
Closes the database. |
String |
debug(O object)
Print debug info. |
OperationStatus |
deleteAux(O object)
Deletes the entry of this object in the index. |
OperationStatus |
exists(O object)
Returns true if the given object exists in the database. |
protected void |
freezeDefault()
|
abstract byte[] |
getAddress(B bucket)
Gets the byte address of the given object |
abstract B |
getBucket(O object)
Returns the bucket information for the given object. |
protected BC |
getBucketContainer(byte[] id)
|
OBStore<TupleBytes> |
getBuckets()
|
protected O |
getObjectFreeze(long id,
cern.colt.list.LongArrayList elementSource)
Auxiliary function used in freeze to get objects directly from the DB, or by using an array of object ids. |
protected long |
idMap(long id,
cern.colt.list.LongArrayList elementSource)
If elementSource == null returns id, otherwise it returns elementSource[id] |
void |
init(OBStoreFactory fact)
Initialize the index. |
protected void |
initByteArrayBuckets()
Initializes the bucket byte array storage. |
OperationStatus |
insertAux(long id,
O object)
Inserts the given object into the particular index. |
OperationStatus |
insertAuxBulk(long id,
O object)
Inserts the given object into the particular index. |
protected OperationStatus |
insertBucket(B b,
O object)
Stores the given bucket b into the Buckets storage device. |
protected OperationStatus |
insertBucketBulk(B b,
O object)
Stores the given bucket b into the Buckets storage device. |
protected abstract BC |
instantiateBucketContainer(byte[] data,
byte[] address)
Get a bucket container from the given data. |
Iterator<BC> |
iterateBuckets()
Useful iterator for buckets. |
protected abstract int |
primitiveDataTypeSize()
Return the size in bytes of the underlying primitive datatype. |
Methods inherited from class net.obsearch.index.pivot.AbstractPivotOBIndex |
---|
calculateIntrinsicDimensionality, createPivotsArray, freeze, getObjects, getPivotCount, selectPivots |
Methods inherited from class net.obsearch.index.AbstractOBIndex |
---|
assertFrozen, bytesToObject, bytesToObject, clearACache, databaseSize, delete, distance, emptyPivotsArray, findAux, getBox, getObject, getStats, getType, initCache, initStorageDevices, insert, insert, insertBulk, insertBulk, intrinsicDimensionality, isFrozen, isPreFreeze, isPreFreezeCheck, loadObject, loadPivots, objectToByteBuffer, objectToBytes, resetStats, serializePivots, setFixedRecord, setFixedRecord, setIdAutoGeneration, setPreFreeze, setPreFreezeCheck, totalBoxes |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected transient OBStore<TupleBytes> Buckets
Constructor Detail |
---|
public AbstractBucketIndex(Class<O> type, IncrementalPivotSelector<O> pivotSelector, int pivotCount) throws OBStorageException, OBException
OBStorageException
OBException
public AbstractBucketIndex()
Method Detail |
---|
protected long idMap(long id, cern.colt.list.LongArrayList elementSource) throws OBException
OBException
protected O getObjectFreeze(long id, cern.colt.list.LongArrayList elementSource) throws IllegalIdException, IllegalAccessException, InstantiationException, OutOfRangeException, OBException
IllegalIdException
IllegalAccessException
InstantiationException
OutOfRangeException
OBException
public Iterator<BC> iterateBuckets() throws OBStorageException, OBException
OBException
OBStorageException
public abstract B getBucket(O object) throws OBException, InstantiationException, IllegalAccessException
object
- The object that will be calculated
IllegalAccessException
OBException
InstantiationException
protected void initByteArrayBuckets() throws OBException
OBException
protected abstract int primitiveDataTypeSize()
public void init(OBStoreFactory fact) throws OBStorageException, OBException, InstantiationException, IllegalAccessException
AbstractOBIndex
init
in interface Index<O extends OB>
init
in class AbstractPivotOBIndex<O extends OB>
fact
- The storage factory that will be used to store the data.
OBStorageException
- If something goes wrong with the DB
OBException
- User generated exception
NotFrozenException
- if the index has not been frozen.
InstantiationException
- If there is a problem when instantiating objects O
IllegalAccessException
- If there is a problem when instantiating objects Oprotected OperationStatus insertBucket(B b, O object) throws OBStorageException, IllegalIdException, IllegalAccessException, InstantiationException, OutOfRangeException, OBException
Buckets
storage device. The
given bucket b should have been returned by #getBucket(OB, int)
b
- The bucket in which we will insert the object.object
- The object to insert.
OBStorageException
IllegalIdException
IllegalAccessException
InstantiationException
OutOfRangeException
OBException
protected BC getBucketContainer(byte[] id) throws OBException, InstantiationException, IllegalAccessException
OBException
InstantiationException
IllegalAccessException
protected OperationStatus insertBucketBulk(B b, O object) throws OBStorageException, IllegalIdException, IllegalAccessException, InstantiationException, OutOfRangeException, OBException
Buckets
storage device. The
given bucket b should have been returned by #getBucket(OB, int)
No checks are performed, we simply add the objects believing they are
unique.
b
- The bucket in which we will insert the object.object
- The object to insert.
OBStorageException
IllegalIdException
IllegalAccessException
InstantiationException
OutOfRangeException
OBException
public OperationStatus exists(O object) throws OBException, IllegalAccessException, InstantiationException
Index
object
- The object that will be searched.
Status.EXISTS
and the object's id if
the object exists in the database, otherwise
Status.NOT_EXISTS
is returned.
OBStorageException
- If something goes wrong with the DB
OBException
- User generated exception
IllegalAccessException
- If there is a problem when instantiating objects O
InstantiationException
- If there is a problem when instantiating objects Oprotected void freezeDefault() throws AlreadyFrozenException, IllegalIdException, IllegalAccessException, InstantiationException, OutOfRangeException, OBException
AlreadyFrozenException
IllegalIdException
IllegalAccessException
InstantiationException
OutOfRangeException
OBException
public void close() throws OBException
Index
close
in interface Index<O extends OB>
close
in class AbstractOBIndex<O extends OB>
OBStorageException
- If something goes wrong with the DB.
OBException
public abstract byte[] getAddress(B bucket) throws OBException
object
- An object.
OBException
protected void bucketStats() throws OBStorageException, IllegalIdException, IllegalAccessException, InstantiationException, OBException
OBStorageException
IllegalIdException
IllegalAccessException
InstantiationException
OBException
public OperationStatus deleteAux(O object) throws OBException, IllegalAccessException, InstantiationException
AbstractOBIndex
Status.OK
.
deleteAux
in class AbstractOBIndex<O extends OB>
object
- object to be deleted.
Status.OK
if the object was deleted.
Status.NOT_EXISTS
no object matched.
OBException
IllegalAccessException
InstantiationException
public OBStore<TupleBytes> getBuckets()
public OperationStatus insertAux(long id, O object) throws OBException, IllegalAccessException, InstantiationException
AbstractOBIndex
insertAux
in class AbstractOBIndex<O extends OB>
id
- The id that will be used to insert the object.object
- The object that will be inserted.
Status.OK
or
Status.EXISTS
then the result will hold the
id of the inserted object and the operation is successful.
Otherwise an exception will be thrown.
OBStorageException
OBException
IllegalAccessException
InstantiationException
public OperationStatus insertAuxBulk(long id, O object) throws OBException, IllegalAccessException, InstantiationException
AbstractOBIndex
insertAuxBulk
in class AbstractOBIndex<O extends OB>
id
- The id that will be used to insert the object.object
- The object that will be inserted.
Status.OK
OBStorageException
OBException
IllegalAccessException
InstantiationException
protected abstract BC instantiateBucketContainer(byte[] data, byte[] address) throws InstantiationException, IllegalAccessException, OBException
data
- The data from which the bucket container will be loaded.
IOException
OBException
IllegalAccessException
InstantiationException
public String debug(O object) throws OBException, InstantiationException, IllegalAccessException
debug
in interface Index<O extends OB>
debug
in class AbstractOBIndex<O extends OB>
OBException
InstantiationException
IllegalAccessException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |