|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmessif.algorithms.Algorithm
messif.algorithms.impl.SequentialScan
public class SequentialScan
Implementation of the naive sequential scan algorithm. It uses one bucket to store objects and performs operations on the bucket. It also supports pivot-based filtering. The pivots can be specified in a constructor.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class messif.algorithms.Algorithm |
---|
Algorithm.AlgorithmConstructor |
Field Summary | |
---|---|
protected LocalBucket |
bucket
One instance of bucket where all objects are stored |
protected boolean |
pivotDistsValidIfGiven
Flag controlling the usage of PrecomputedDistancesFixedArrayFilter -- whether distances are set or appended (see the constructor below for details) |
protected AbstractObjectList<LocalAbstractObject> |
pivots
A list of fixed pivots used for filtering |
Fields inherited from class messif.algorithms.Algorithm |
---|
log, maximalConcurrentOperations |
Constructor Summary | |
---|---|
SequentialScan()
Creates a new instance of SequantialScan access structure with the default MemoryStorageBucket class. |
|
SequentialScan(java.lang.Class<? extends LocalBucket> bucketClass)
Creates a new instance of SequantialScan access structure with specific bucket class. |
|
SequentialScan(java.lang.Class<? extends LocalBucket> bucketClass,
AbstractObjectIterator<LocalAbstractObject> pivotIter,
int pivotCount,
boolean pivotDistsValidIfGiven)
Creates a new instance of SequantialScan access structure with specific bucket class and filtering pivots. |
|
SequentialScan(java.lang.Class<? extends LocalBucket> bucketClass,
java.util.Map<java.lang.String,java.lang.Object> bucketClassParams)
Creates a new instance of SequantialScan access structure with specific bucket class. |
|
SequentialScan(java.lang.Class<? extends LocalBucket> bucketClass,
java.util.Map<java.lang.String,java.lang.Object> bucketClassParams,
AbstractObjectIterator<LocalAbstractObject> pivotIter,
int pivotCount,
boolean pivotDistsValidIfGiven)
Creates a new instance of SequantialScan access structure with specific bucket class and filtering pivots. |
Method Summary | |
---|---|
protected void |
addPrecompDist(LocalAbstractObject object)
Add precomputed distances to a given object. |
void |
approxKNNSearch(ApproxKNNQueryOperation operation)
Performs the approximate k-nearest neighbor search operation with given ApproxKNNQueryOperation object. |
void |
bulkInsert(BulkInsertOperation operation)
Bulk insertion. |
void |
delete(DeleteByLocatorOperation operation)
Deletes objects by locators. |
void |
delete(DeleteOperation operation)
Deletes an object. |
void |
destroy()
Destroy this algorithm. |
void |
finalize()
Finalize the algorithm. |
void |
incrementalNNSearch(IncrementalNNQueryOperation operation)
Performs the incremental nearest neighbor search operation with given IncrementalNNQueryOperation object. |
void |
insert(InsertOperation operation)
Inserts a new object. |
void |
knnSearch(KNNQueryOperation operation)
Performs the k-nearest neighbor search operation with given KNNQueryOperation object. |
void |
rangeSearch(RangeQueryOperation operation)
Performs the range search operation with given RangeQueryOperation object. |
void |
search(QueryOperation<?> operation)
Performs a generic query operation. |
java.lang.String |
toString()
Converts the object to a string representation |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final LocalBucket bucket
protected final AbstractObjectList<LocalAbstractObject> pivots
protected final boolean pivotDistsValidIfGiven
Constructor Detail |
---|
public SequentialScan(java.lang.Class<? extends LocalBucket> bucketClass, java.util.Map<java.lang.String,java.lang.Object> bucketClassParams, AbstractObjectIterator<LocalAbstractObject> pivotIter, int pivotCount, boolean pivotDistsValidIfGiven) throws CapacityFullException, java.lang.InstantiationException
bucketClass
- the class of the storage bucketbucketClassParams
- additional parameters for the bucket class constructor in the name->value formpivotIter
- the iterator from which the fixed pivots will be readpivotCount
- the nubmer of pivots to read from the iteratorpivotDistsValidIfGiven
- the flag which controls whether the already associated distances to pivots with new objects are valid or not; if so, they are used without computing and storing them again
CapacityFullException
- if the maximal number of buckets is already allocated
java.lang.InstantiationException
- if public SequentialScan(java.lang.Class<? extends LocalBucket> bucketClass, AbstractObjectIterator<LocalAbstractObject> pivotIter, int pivotCount, boolean pivotDistsValidIfGiven) throws CapacityFullException, java.lang.InstantiationException
bucketClass
- The class of the storage bucketpivotIter
- The iterator from which the fixed pivots will be readpivotCount
- The nubmer of pivots to read from the iteratorpivotDistsValidIfGiven
- The flag which controls whether the already associated distances to pivots with new objects are valid or not. If so, they are used without computing and storing them again.
CapacityFullException
- if the maximal number of buckets is already allocated
java.lang.InstantiationException
- if public SequentialScan(java.lang.Class<? extends LocalBucket> bucketClass, java.util.Map<java.lang.String,java.lang.Object> bucketClassParams) throws CapacityFullException, java.lang.InstantiationException
bucketClass
- The class of the storage bucketbucketClassParams
- additional parameters for the bucket class constructor in the name->value form
CapacityFullException
- if the maximal number of buckets is already allocated
java.lang.InstantiationException
- if public SequentialScan(java.lang.Class<? extends LocalBucket> bucketClass) throws CapacityFullException, java.lang.InstantiationException
bucketClass
- The class of the storage bucket
CapacityFullException
- if the maximal number of buckets is already allocated
java.lang.InstantiationException
- if public SequentialScan() throws CapacityFullException, java.lang.InstantiationException
CapacityFullException
- if the maximal number of buckets is already allocated
java.lang.InstantiationException
- if Method Detail |
---|
protected void addPrecompDist(LocalAbstractObject object)
PrecomputedDistancesFixedArrayFilter
.
object
- the object to add the distances topublic void finalize() throws java.lang.Throwable
Algorithm
finalize
in class Algorithm
java.lang.Throwable
- if there was an error finalizingpublic void destroy() throws java.lang.Throwable
Algorithm
This implementation defaults to call Algorithm.finalize()
, but should be overriden
if the algorithm needs to differentiate between finalizing and destroying. In that case
the "super.destroy()" should not be called if finalizing is not part of destroy.
destroy
in class Algorithm
java.lang.Throwable
- if there was an error while cleaningpublic void insert(InsertOperation operation) throws CapacityFullException
operation
- Operation of insert which carries the object to be inserted.
CapacityFullException
- if the hard capacity of the bucket is exceededpublic void bulkInsert(BulkInsertOperation operation) throws BucketStorageException
operation
- The operation of bulk insert which carries the objects to be inserted.
BucketStorageException
- if the hard capacity of the bucket is exceededpublic void delete(DeleteOperation operation) throws BucketStorageException
operation
- The operation which specifies the object to be deleted.
BucketStorageException
- if the low occupation limit is reached when deleting objectpublic void delete(DeleteByLocatorOperation operation) throws BucketStorageException
operation
- the operation which specifies the locators of objects to be deleted
BucketStorageException
- if the low occupation limit is reached when deleting objectpublic void rangeSearch(RangeQueryOperation operation)
operation
- The range query operation which carries the query object and radius as well as the response list.public void knnSearch(KNNQueryOperation operation)
operation
- The kNN query operation which carries the query object and k as well as the response list.public void incrementalNNSearch(IncrementalNNQueryOperation operation)
operation
- The incremental NN query operation which carries the query object as well as the response list.public void approxKNNSearch(ApproxKNNQueryOperation operation)
operation
- The approximate kNN query operation which carries the query object and k as well as the response list.public void search(QueryOperation<?> operation) throws java.lang.CloneNotSupportedException, java.lang.InterruptedException
operation
- the query operation which is to be executed and which will received the result list.
java.lang.CloneNotSupportedException
- if the operation does not support clonning (and thus cannot be used in parallel)
java.lang.InterruptedException
- if the processing thread was interrupted during processingpublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |