T
-public class QuadTreeDistIndex<T> extends DistributedSpatialIndex<T>
DistributedSpatialIndex
based on a QuadTreeConstructor and Description |
---|
QuadTreeDistIndex(java.lang.Class<T> type)
Crates a new instance ready for an RDD of the given generic type
|
Modifier and Type | Method and Description |
---|---|
void |
cache()
Persist the index' internal RDD with the default storage level
|
SpatialJavaRDD<T> |
filter(<any> filterFunc, SpatialOperationConfig spatialOpConf)
Returns a new spatial RDD containing only the elements that satisfy both, the filtering function and the spatial operation
|
<R> <any> |
flatMap(<any> f, SpatialOperationConfig spatialOpConf)
Returns a new RDD by first spatially filtering the RDD elements using the spatial operation given by spatialOpConf, then a function is applied to all the remaining elements.
|
<T2,R> <any> |
join(SpatialJavaRDD<T2> rdd2, <any> f, SpatialOperationConfig spatialOpConf)
Joins the records of the current index' data set with another spatial data set based on a spatial relationship between both data set's records
|
java.util.List<<any>> |
nearestNeighbors(<any> f, int k, SpatialOperationConfig spatialOpConf)
Returns the k elements from the RDD which are closest to the query window defined in spatialOpConf
|
void |
persist(StorageLevel storageLevel)
Sets the index' internal RDD's storage level to persist its values across operations after the first time it is computed.
|
void |
read(JavaSparkContext sc, java.lang.String file)
Loads a persisted index from the given path.
|
void |
unpersist()
Marks the index' internal RDD as non-persistent
|
void |
write(JavaSparkContext sc, java.lang.String pathStr)
Writes the current index to the given path
|
createIndex, load, load, save
public QuadTreeDistIndex(java.lang.Class<T> type)
type
-public void cache()
DistributedSpatialIndex
cache
in class DistributedSpatialIndex<T>
public SpatialJavaRDD<T> filter(<any> filterFunc, SpatialOperationConfig spatialOpConf) throws java.lang.Exception
DistributedSpatialIndex
filter
in class DistributedSpatialIndex<T>
filterFunc
- a filtering functionspatialOpConf
- the spatial operation configuration to spatially filter the RDDSpatialJavaRDD
java.lang.Exception
public <R> <any> flatMap(<any> f, SpatialOperationConfig spatialOpConf) throws java.lang.Exception
DistributedSpatialIndex
flatMap
in class DistributedSpatialIndex<T>
f
- a function to apply to each elementspatialOpConf
- the spatial operation configuration to spatially filter the RDDjava.lang.Exception
public <T2,R> <any> join(SpatialJavaRDD<T2> rdd2, <any> f, SpatialOperationConfig spatialOpConf) throws java.lang.Exception
DistributedSpatialIndex
join
in class DistributedSpatialIndex<T>
rdd2
- a spatial RDD to join withf
- a tuple processor function which receives a tuple of records from both data sets which match the spatial join conditionspatialOpConf
- a spatial operation configuration defining the spatial relationship to join recordsjava.lang.Exception
public java.util.List<<any>> nearestNeighbors(<any> f, int k, SpatialOperationConfig spatialOpConf) throws java.lang.Exception
DistributedSpatialIndex
nearestNeighbors
in class DistributedSpatialIndex<T>
f
- an optional filtering function which should return true for the elements which can be part of the solutionk
- the number of nearest neighbors to returnspatialOpConf
- a spatial configuration containing the query window to be used. SpatialOperation is ignored for this action.java.lang.Exception
public void persist(StorageLevel storageLevel)
DistributedSpatialIndex
persist
in class DistributedSpatialIndex<T>
public void read(JavaSparkContext sc, java.lang.String file) throws java.lang.Exception
DistributedSpatialIndex
read
in class DistributedSpatialIndex<T>
sc
- an existing Spark contextfile
- a path on either, a local or distributed file systemjava.lang.Exception
public void unpersist()
DistributedSpatialIndex
unpersist
in class DistributedSpatialIndex<T>
public void write(JavaSparkContext sc, java.lang.String pathStr) throws java.lang.Exception
DistributedSpatialIndex
write
in class DistributedSpatialIndex<T>
sc
- an existing Spark contextpathStr
- a path on either, a local or distributed file systemjava.lang.Exception
Copyright © 2016 Oracle and/or its affiliates. All Rights Reserved.