PARTITION_VALUE - STORE_VALUE - @See Partitioner @See Partitioner.PartitionDatapublic class NNProcessor<PARTITION_VALUE,STORE_VALUE> extends Object
(1) Partition added data using a partitioner.
(2) Process data, perform the O(N^2) (e.g. ~ n^2/2) comparisons within those partitions.
Custom plug-ins include (1) A factory for the neighbor list to track those pairings of data whose distance feel under the provided minimum. (2) A complete notification callback callback for each primary data.
The loop algorithms is For each primary compare to all remaining primary and all secondary data items
A powerful performance enhancing tool is the inference mechanism associated with the neighborhood lists. A list can have intelligence to decide that a particular neighbor can be inferred and, therefore, can be removed from the set of primaries to be inspected. This has no effect on secondaries.
The processor can be called multiple times, as the 'process' algorithm does not alter its internal state. The notification callback can be used to alter the internal state (e.g. calling 'add' or 'remove' methods). Caution should used to alter internal state within the neighbor list.
| Modifier and Type | Class and Description |
|---|---|
static interface |
NNProcessor.CompleteNotifier<STORE_VALUE> |
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_UPPER_BOUND_PARTIION_SIZE |
protected DistanceProfileGenerateFn<?,STORE_VALUE> |
distanceProfileFn |
protected NeighborIndex<STORE_VALUE> |
index |
protected static org.slf4j.Logger |
LOGGER |
protected double |
maxDistance |
protected Partitioner.PartitionData |
parentPartition |
protected Partitioner<Object> |
partitioner |
protected org.locationtech.geowave.core.index.ByteArray |
startingPoint
Run State
|
protected TypeConverter<STORE_VALUE> |
typeConverter |
| Constructor and Description |
|---|
NNProcessor(Partitioner<Object> partitioner,
TypeConverter<STORE_VALUE> typeConverter,
DistanceProfileGenerateFn<?,STORE_VALUE> distanceProfileFn,
double maxDistance,
Partitioner.PartitionData parentPartition) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(org.locationtech.geowave.core.index.ByteArray id,
boolean isPrimary,
PARTITION_VALUE partitionValue) |
int |
getUpperBoundPerPartition() |
void |
process(NeighborListFactory<STORE_VALUE> listFactory,
NNProcessor.CompleteNotifier<STORE_VALUE> notification) |
void |
remove(org.locationtech.geowave.core.index.ByteArray id) |
void |
setUpperBoundPerPartition(int upperBoundPerPartition) |
int |
size() |
boolean |
trimSmallPartitions(int size) |
protected static final org.slf4j.Logger LOGGER
protected final Partitioner<Object> partitioner
protected final TypeConverter<STORE_VALUE> typeConverter
protected final DistanceProfileGenerateFn<?,STORE_VALUE> distanceProfileFn
protected final double maxDistance
protected final Partitioner.PartitionData parentPartition
public static final int DEFAULT_UPPER_BOUND_PARTIION_SIZE
protected org.locationtech.geowave.core.index.ByteArray startingPoint
protected NeighborIndex<STORE_VALUE> index
public NNProcessor(Partitioner<Object> partitioner, TypeConverter<STORE_VALUE> typeConverter, DistanceProfileGenerateFn<?,STORE_VALUE> distanceProfileFn, double maxDistance, Partitioner.PartitionData parentPartition)
public void remove(org.locationtech.geowave.core.index.ByteArray id)
public void add(org.locationtech.geowave.core.index.ByteArray id,
boolean isPrimary,
PARTITION_VALUE partitionValue)
throws IOException
IOExceptionpublic int size()
public boolean trimSmallPartitions(int size)
size - the minimum size of a partition to be processedpublic void process(NeighborListFactory<STORE_VALUE> listFactory, NNProcessor.CompleteNotifier<STORE_VALUE> notification) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic int getUpperBoundPerPartition()
public void setUpperBoundPerPartition(int upperBoundPerPartition)
Copyright © 2013–2022. All rights reserved.