T -public class QuadTreeDistIndex<T> extends DistributedSpatialIndex<T>
DistributedSpatialIndex based on a QuadTreeBOOTSTRAP_FILE, type| 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(org.apache.spark.api.java.function.Function<T,java.lang.Boolean> filterFunc, SpatialOperationConfig spatialOpConf)
Returns a new spatial RDD containing only the elements that satisfy both, the filtering function and the spatial operation
|
<R> org.apache.spark.api.java.JavaRDD<R> |
flatMap(org.apache.spark.api.java.function.FlatMapFunction<T,R> 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.
|
protected void |
index(org.apache.spark.api.java.JavaSparkContext sc, SpatialJavaRDD<T> rdd, SpatialPartitioningConfiguration partConf)
Spatially indexes an RDD.
|
<T2,R> org.apache.spark.api.java.JavaRDD<R> |
join(SpatialJavaRDD<T2> rdd2, org.apache.spark.api.java.function.Function2<T,T2,R> 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
|
void |
persist(org.apache.spark.storage.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(org.apache.spark.api.java.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(org.apache.spark.api.java.JavaSparkContext sc, java.lang.String pathStr)
Writes the current index to the given path
|
createIndex, load, savepublic QuadTreeDistIndex(java.lang.Class<T> type)
type -
protected void index(org.apache.spark.api.java.JavaSparkContext sc,
SpatialJavaRDD<T> rdd,
SpatialPartitioningConfiguration partConf)
DistributedSpatialIndexindex in class DistributedSpatialIndex<T>sc - an existing Spark contextrdd - a spatial RDDpartConf - the indexing and partitioning configurationpublic SpatialJavaRDD<T> filter(org.apache.spark.api.java.function.Function<T,java.lang.Boolean> 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.Exceptionpublic <R> org.apache.spark.api.java.JavaRDD<R> flatMap(org.apache.spark.api.java.function.FlatMapFunction<T,R> 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> org.apache.spark.api.java.JavaRDD<R> join(SpatialJavaRDD<T2> rdd2, org.apache.spark.api.java.function.Function2<T,T2,R> 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.Exceptionpublic void persist(org.apache.spark.storage.StorageLevel storageLevel)
DistributedSpatialIndexpersist in class DistributedSpatialIndex<T>public void unpersist()
DistributedSpatialIndexunpersist in class DistributedSpatialIndex<T>public void cache()
DistributedSpatialIndexcache in class DistributedSpatialIndex<T>
public void write(org.apache.spark.api.java.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.Exception
public void read(org.apache.spark.api.java.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.ExceptionCopyright © 2016 Oracle and/or its affiliates. All Rights Reserved.