T -public class QuadTreeDistIndex<T> extends DistributedSpatialIndex<T>
DistributedSpatialIndex based on a QuadTree| Constructor 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, savepublic QuadTreeDistIndex(java.lang.Class<T> type)
type -public void cache()
DistributedSpatialIndexcache in class DistributedSpatialIndex<T>public SpatialJavaRDD<T> filter(<any> filterFunc, SpatialOperationConfig spatialOpConf) throws java.lang.Exception
DistributedSpatialIndexfilter in class DistributedSpatialIndex<T>filterFunc - a filtering functionspatialOpConf - the spatial operation configuration to spatially filter the RDDSpatialJavaRDDjava.lang.Exception
public <R> <any> flatMap(<any> f,
SpatialOperationConfig spatialOpConf)
throws java.lang.Exception
DistributedSpatialIndexflatMap in class DistributedSpatialIndex<T>f - a function to apply to each elementspatialOpConf - the spatial operation configuration to spatially filter the RDDjava.lang.Exceptionpublic <T2,R> <any> join(SpatialJavaRDD<T2> rdd2, <any> f, SpatialOperationConfig spatialOpConf) throws java.lang.Exception
DistributedSpatialIndexjoin 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
DistributedSpatialIndexnearestNeighbors 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.Exceptionpublic void persist(StorageLevel storageLevel)
DistributedSpatialIndexpersist in class DistributedSpatialIndex<T>
public void read(JavaSparkContext sc,
java.lang.String file)
throws java.lang.Exception
DistributedSpatialIndexread in class DistributedSpatialIndex<T>sc - an existing Spark contextfile - a path on either, a local or distributed file systemjava.lang.Exceptionpublic void unpersist()
DistributedSpatialIndexunpersist in class DistributedSpatialIndex<T>
public void write(JavaSparkContext sc,
java.lang.String pathStr)
throws java.lang.Exception
DistributedSpatialIndexwrite in class DistributedSpatialIndex<T>sc - an existing Spark contextpathStr - a path on either, a local or distributed file systemjava.lang.ExceptionCopyright © 2016 Oracle and/or its affiliates. All Rights Reserved.