Class NestedLoopJudgement<T extends org.locationtech.jts.geom.Geometry,U extends org.locationtech.jts.geom.Geometry>
- java.lang.Object
- 
- org.apache.sedona.core.joinJudgement.NestedLoopJudgement<T,U>
 
- 
- All Implemented Interfaces:
- Serializable,- org.apache.spark.api.java.function.FlatMapFunction2<Iterator<T>,Iterator<U>,org.apache.commons.lang3.tuple.Pair<U,T>>
 
 public class NestedLoopJudgement<T extends org.locationtech.jts.geom.Geometry,U extends org.locationtech.jts.geom.Geometry> extends Object implements org.apache.spark.api.java.function.FlatMapFunction2<Iterator<T>,Iterator<U>,org.apache.commons.lang3.tuple.Pair<U,T>>, Serializable - See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description NestedLoopJudgement(SpatialPredicate spatialPredicate, org.apache.spark.util.LongAccumulator buildCount, org.apache.spark.util.LongAccumulator streamCount, org.apache.spark.util.LongAccumulator resultCount, org.apache.spark.util.LongAccumulator candidateCount)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Iterator<org.apache.commons.lang3.tuple.Pair<U,T>>call(Iterator<T> iteratorObject, Iterator<U> iteratorWindow)protected booleanhasNextBase(List<? extends org.locationtech.jts.geom.Geometry> buildShapes, Iterator<? extends org.locationtech.jts.geom.Geometry> streamShapes)Iterator model for the nest loop join.protected booleanhasNextBase(org.locationtech.jts.index.SpatialIndex spatialIndex, Iterator<? extends org.locationtech.jts.geom.Geometry> streamShapes, boolean buildLeft)Iterator model for the index-based join.protected voidinitPartition()Looks up the extent of the current partition.protected voidlog(String message, Object... params)protected org.apache.commons.lang3.tuple.Pair<U,T>nextBase(List<? extends org.locationtech.jts.geom.Geometry> buildShapes, Iterator<? extends org.locationtech.jts.geom.Geometry> streamShapes)Iterator model for the nest loop join.protected org.apache.commons.lang3.tuple.Pair<U,T>nextBase(org.locationtech.jts.index.SpatialIndex spatialIndex, Iterator<? extends org.locationtech.jts.geom.Geometry> streamShapes, boolean buildLeft)Iterator model for the index-based join.
 
- 
- 
- 
Field Detail- 
buildCountprotected final org.apache.spark.util.LongAccumulator buildCount 
 - 
streamCountprotected final org.apache.spark.util.LongAccumulator streamCount 
 - 
resultCountprotected final org.apache.spark.util.LongAccumulator resultCount 
 - 
candidateCountprotected final org.apache.spark.util.LongAccumulator candidateCount 
 
- 
 - 
Constructor Detail- 
NestedLoopJudgementpublic NestedLoopJudgement(SpatialPredicate spatialPredicate, org.apache.spark.util.LongAccumulator buildCount, org.apache.spark.util.LongAccumulator streamCount, org.apache.spark.util.LongAccumulator resultCount, org.apache.spark.util.LongAccumulator candidateCount) - See Also:
- JudgementBase
 
 
- 
 - 
Method Detail- 
callpublic Iterator<org.apache.commons.lang3.tuple.Pair<U,T>> call(Iterator<T> iteratorObject, Iterator<U> iteratorWindow) throws Exception - Specified by:
- callin interface- org.apache.spark.api.java.function.FlatMapFunction2<Iterator<T extends org.locationtech.jts.geom.Geometry>,Iterator<U extends org.locationtech.jts.geom.Geometry>,org.apache.commons.lang3.tuple.Pair<U extends org.locationtech.jts.geom.Geometry,T extends org.locationtech.jts.geom.Geometry>>
- Throws:
- Exception
 
 - 
initPartitionprotected void initPartition() Looks up the extent of the current partition. If found, `match` method will activate the logic to avoid emitting duplicate join results from multiple partitions.Must be called before processing a partition. Must be called from the same instance that will be used to process the partition. 
 - 
hasNextBaseprotected boolean hasNextBase(org.locationtech.jts.index.SpatialIndex spatialIndex, Iterator<? extends org.locationtech.jts.geom.Geometry> streamShapes, boolean buildLeft)Iterator model for the index-based join. It checks if there is a next match and populate it to the result.- Parameters:
- spatialIndex-
- streamShapes-
- buildLeft-
- Returns:
 
 - 
hasNextBaseprotected boolean hasNextBase(List<? extends org.locationtech.jts.geom.Geometry> buildShapes, Iterator<? extends org.locationtech.jts.geom.Geometry> streamShapes) Iterator model for the nest loop join. It checks if there is a next match and populate it to the result.- Parameters:
- buildShapes-
- streamShapes-
- Returns:
 
 - 
nextBaseprotected org.apache.commons.lang3.tuple.Pair<U,T> nextBase(org.locationtech.jts.index.SpatialIndex spatialIndex, Iterator<? extends org.locationtech.jts.geom.Geometry> streamShapes, boolean buildLeft)Iterator model for the index-based join. It returns 1 pair in the current batch. Each batch contains a list of pairs of geometries that satisfy the join condition. The current batch is the result of the current stream shape against all the build shapes.- Parameters:
- spatialIndex-
- streamShapes-
- buildLeft-
- Returns:
 
 - 
nextBaseprotected org.apache.commons.lang3.tuple.Pair<U,T> nextBase(List<? extends org.locationtech.jts.geom.Geometry> buildShapes, Iterator<? extends org.locationtech.jts.geom.Geometry> streamShapes) Iterator model for the nest loop join. It returns 1 pair in the current batch. Each batch contains a list of pairs of geometries that satisfy the join condition. The current batch is the result of the current stream shape against all the build shapes.- Parameters:
- buildShapes-
- streamShapes-
- Returns:
 
 
- 
 
-