|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.obsearch.index.AbstractOBIndex<O> net.obsearch.index.pivot.AbstractPivotOBIndex<O>
public abstract class AbstractPivotOBIndex<O extends OB>
AbstractPivotOBIndex defines abstract functionality for an index that uses n pivots to partition the data into more tractable subsets. To create a new index, do the following: 1) Implement objectToProjectionBytes(O object) (smap an object and codify it) 2) Implement deleteAux 3) Implement insertAux 4) Implement searchOB. That's all!
Field Summary | |
---|---|
protected int |
intrinsicDimensionalityPairs
Use the following amount of pairs when the intrinsic dimensionality is calculated. |
protected O[] |
pivots
The pivots for this Tree. |
protected IncrementalPivotSelector<O> |
pivotSelector
The pivot selector used by the index. |
Fields inherited from class net.obsearch.index.AbstractOBIndex |
---|
A, fact, isFrozen, stats, type |
Fields inherited from interface net.obsearch.Index |
---|
ID_SIZE |
Constructor Summary | |
---|---|
protected |
AbstractPivotOBIndex()
|
protected |
AbstractPivotOBIndex(Class<O> type,
IncrementalPivotSelector<O> pivotSelector,
int pivotCount)
Creates an index that uses pivots as its major data partitioning strategy. |
Method Summary | |
---|---|
protected double |
calculateIntrinsicDimensionality()
Calculates the intrinsic dimensionality of the inserted dataset. |
protected void |
createPivotsArray(int size)
Creates an array with the pivots. |
void |
freeze()
Freezes the index. |
protected O[] |
getObjects(long[] ids)
Stores the given pivots in a local array. |
int |
getPivotCount()
|
void |
init(OBStoreFactory fact)
Initialize the index. |
protected PivotResult |
selectPivots(int pivotCount,
IncrementalPivotSelector<O> pivotSelector)
Override this method if selection must be changed |
Methods inherited from class net.obsearch.index.AbstractOBIndex |
---|
assertFrozen, bytesToObject, bytesToObject, clearACache, close, databaseSize, debug, delete, deleteAux, distance, emptyPivotsArray, findAux, getBox, getObject, getStats, getType, initCache, initStorageDevices, insert, insert, insertAux, insertAuxBulk, 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 |
Methods inherited from interface net.obsearch.Index |
---|
exists |
Field Detail |
---|
protected IncrementalPivotSelector<O extends OB> pivotSelector
protected O extends OB[] pivots
#pivotsBytes
.
protected int intrinsicDimensionalityPairs
Constructor Detail |
---|
protected AbstractPivotOBIndex(Class<O> type, IncrementalPivotSelector<O> pivotSelector, int pivotCount) throws OBStorageException, OBException
type
- The type of object that will be stored.pivotSelector
- The pivot selection strategy to be employed.pivotCount
- The number of pivots that will be selected.
OBStorageException
OBException
protected AbstractPivotOBIndex()
Method Detail |
---|
public void freeze() throws AlreadyFrozenException, IllegalIdException, IllegalAccessException, InstantiationException, OBStorageException, OutOfRangeException, OBException, PivotsUnavailableException, IOException
Index
freeze
in interface Index<O extends OB>
freeze
in class AbstractOBIndex<O extends OB>
AlreadyFrozenException
- If the index was already frozen and the user attempted to
freeze it again
IllegalIdException
- This exception is left as a Debug flag. If you receive
this exception please report the problem to:
http://code.google.com/p/obsearch/issues/list
IllegalAccessException
- If there is a problem when instantiating objects O
InstantiationException
- If there is a problem when instantiating objects O
OBStorageException
- If something goes wrong with the DB
OutOfRangeException
- If the distance of any object to any other object exceeds
the range defined by the user.
OBException
- User generated exception
PivotsUnavailableException
IOException
- if the index serialization process failsIndex.freeze()
protected double calculateIntrinsicDimensionality() throws IllegalIdException, IllegalAccessException, InstantiationException, OBException
IllegalIdException
IllegalAccessException
InstantiationException
OBException
protected PivotResult selectPivots(int pivotCount, IncrementalPivotSelector<O> pivotSelector) throws AlreadyFrozenException, IllegalIdException, IllegalAccessException, InstantiationException, OBStorageException, OutOfRangeException, OBException, IOException
IOException
AlreadyFrozenException
IllegalIdException
IllegalAccessException
InstantiationException
OBStorageException
OutOfRangeException
OBException
protected O[] getObjects(long[] ids) throws IllegalIdException, IllegalAccessException, InstantiationException, OBException
ids
- Ids of the pivots that will be stored.
IllegalIdException
- If the pivot selector generates invalid ids
com.sleepycat.je.DatabaseException
- 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 createPivotsArray(int size)
public int getPivotCount()
public void init(OBStoreFactory fact) throws OBStorageException, OBException, NotFrozenException, IllegalAccessException, InstantiationException, OBException
AbstractOBIndex
init
in interface Index<O extends OB>
init
in class AbstractOBIndex<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.
IllegalAccessException
- If there is a problem when instantiating objects O
InstantiationException
- If there is a problem when instantiating objects O
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |