V
- the vector type.public class ParallelSearcher<V extends ValueVector> extends Object
Constructor and Description |
---|
ParallelSearcher(V vector,
ExecutorService threadPool,
int numThreads)
Constructs a parallel searcher.
|
Modifier and Type | Method and Description |
---|---|
int |
search(V keyVector,
int keyIndex)
Search for the key in the target vector.
|
int |
search(V keyVector,
int keyIndex,
VectorValueComparator<V> comparator)
Search for the key in the target vector.
|
public ParallelSearcher(V vector, ExecutorService threadPool, int numThreads)
vector
- the vector to search.threadPool
- the thread pool to use.numThreads
- the number of threads to use.public int search(V keyVector, int keyIndex) throws ExecutionException, InterruptedException
RangeEqualsVisitor
, so there are two possible results for each element-wise
comparison: equal and un-equal.keyVector
- the vector containing the search key.keyIndex
- the index of the search key in the key vector.VectorSearcher.linearSearch(ValueVector, VectorValueComparator, ValueVector, int)
.ExecutionException
- if an exception occurs in a thread.InterruptedException
- if a thread is interrupted.public int search(V keyVector, int keyIndex, VectorValueComparator<V> comparator) throws ExecutionException, InterruptedException
VectorValueComparator
, so there are three possible results for each element-wise
comparison: less than, equal to and greater than.keyVector
- the vector containing the search key.keyIndex
- the index of the search key in the key vector.comparator
- the comparator for comparing the key against vector elements.VectorSearcher.linearSearch(ValueVector, VectorValueComparator, ValueVector, int)
.ExecutionException
- if an exception occurs in a thread.InterruptedException
- if a thread is interrupted.Copyright © 2023 The Apache Software Foundation. All rights reserved.