net.obsearch.index.perm
Class AbstractDistPerm<O extends OB,B extends BucketObject<O>,Q,BC extends BucketContainer<O,B,Q>>

java.lang.Object
  extended by net.obsearch.index.AbstractOBIndex<O>
      extended by net.obsearch.index.pivot.AbstractPivotOBIndex<O>
          extended by net.obsearch.index.bucket.AbstractBucketIndex<O,B,Q,BC>
              extended by net.obsearch.index.sorter.AbstractBucketSorter<O,B,Q,BC,PermProjection,CompactPerm>
                  extended by net.obsearch.index.perm.AbstractDistPerm<O,B,Q,BC>
All Implemented Interfaces:
Index<O>
Direct Known Subclasses:
DistPermByte, DistPermDouble, DistPermFloat, DistPermInt, DistPermLong, DistPermShort

public abstract class AbstractDistPerm<O extends OB,B extends BucketObject<O>,Q,BC extends BucketContainer<O,B,Q>>
extends AbstractBucketSorter<O,B,Q,BC,PermProjection,CompactPerm>


Nested Class Summary
 
Nested classes/interfaces inherited from class net.obsearch.index.bucket.AbstractBucketIndex
AbstractBucketIndex.BucketIterator
 
Field Summary
 
Fields inherited from class net.obsearch.index.sorter.AbstractBucketSorter
bucketCache, bucketPivotCount, kEstimators, projections, projectionStorage, userK
 
Fields inherited from class net.obsearch.index.bucket.AbstractBucketIndex
Buckets
 
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
AbstractDistPerm(Class<O> type, IncrementalPivotSelector<O> pivotSelector, int pivotCount, int bucketPivotCount)
           
 
Method Summary
protected  CompactPerm bytesToCompactRepresentation(byte[] data)
           
protected  byte[] compactRepresentationToBytes(CompactPerm cp)
           
protected  byte[] convertLongToBytesAddress(long bucketId)
           
 void freeze()
          Freezes the index.
protected  void updateDistance(PermProjection query, CompactPerm proj, FixedPriorityQueue<PermProjection> queue)
          Calculates the distance between a query and some projection
 
Methods inherited from class net.obsearch.index.sorter.AbstractBucketSorter
bucketStats, calculateEstimators, close, estimateK, freezeDefault, getAddress, getAllObjects, getBucketContainer, getBucketPivotCount, getCPSize, getExpectedEP, getKQuery, getMaxK, getPInstance, getProjection, init, initByteArrayBuckets, initCache, insertBucket, insertBucketBulk, loadMasks, maxKEstimation, maxKEstimationAux, printEstimation, searchBuckets, setExpectedError, setKAlpha, setMaxK, setSampleSize
 
Methods inherited from class net.obsearch.index.bucket.AbstractBucketIndex
debug, deleteAux, exists, getBucket, getBuckets, getObjectFreeze, idMap, insertAux, insertAuxBulk, instantiateBucketContainer, iterateBuckets, primitiveDataTypeSize
 
Methods inherited from class net.obsearch.index.pivot.AbstractPivotOBIndex
calculateIntrinsicDimensionality, createPivotsArray, getObjects, getPivotCount, selectPivots
 
Methods inherited from class net.obsearch.index.AbstractOBIndex
assertFrozen, bytesToObject, bytesToObject, clearACache, databaseSize, delete, distance, emptyPivotsArray, findAux, getBox, getObject, getStats, getType, 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
 

Constructor Detail

AbstractDistPerm

public AbstractDistPerm(Class<O> type,
                        IncrementalPivotSelector<O> pivotSelector,
                        int pivotCount,
                        int bucketPivotCount)
                 throws OBStorageException,
                        OBException
Throws:
OBStorageException
OBException
Method Detail

compactRepresentationToBytes

protected byte[] compactRepresentationToBytes(CompactPerm cp)
Specified by:
compactRepresentationToBytes in class AbstractBucketSorter<O extends OB,B extends BucketObject<O>,Q,BC extends BucketContainer<O,B,Q>,PermProjection,CompactPerm>

bytesToCompactRepresentation

protected CompactPerm bytesToCompactRepresentation(byte[] data)
Specified by:
bytesToCompactRepresentation in class AbstractBucketSorter<O extends OB,B extends BucketObject<O>,Q,BC extends BucketContainer<O,B,Q>,PermProjection,CompactPerm>

updateDistance

protected void updateDistance(PermProjection query,
                              CompactPerm proj,
                              FixedPriorityQueue<PermProjection> queue)
Description copied from class: AbstractBucketSorter
Calculates the distance between a query and some projection

Specified by:
updateDistance in class AbstractBucketSorter<O extends OB,B extends BucketObject<O>,Q,BC extends BucketContainer<O,B,Q>,PermProjection,CompactPerm>

convertLongToBytesAddress

protected byte[] convertLongToBytesAddress(long bucketId)

freeze

public void freeze()
            throws AlreadyFrozenException,
                   IllegalIdException,
                   OutOfRangeException,
                   IllegalAccessException,
                   InstantiationException,
                   OBException,
                   PivotsUnavailableException,
                   IOException
Description copied from interface: Index
Freezes the index. From this point data can be inserted, searched and deleted. The index might deteriorate at some point so every once in a while it is a good idea to rebuild the index. A PivotSelector must be executed before calling this method.

Specified by:
freeze in interface Index<O extends OB>
Overrides:
freeze in class AbstractPivotOBIndex<O extends OB>
Throws:
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
OutOfRangeException - If the distance of any object to any other object exceeds the range defined by the user.
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
OBException - User generated exception
PivotsUnavailableException
IOException - if the index serialization process fails
See Also:
Index.freeze()


Copyright © 2007-2011 Arnoldo Jose Muller Molina. All Rights Reserved.