Class PagesSpatialIndexFactory
- java.lang.Object
-
- io.prestosql.operator.PagesSpatialIndexFactory
-
@ThreadSafe public class PagesSpatialIndexFactory extends Object
This factory is used to pass spatial index built by SpatialIndexBuilderOperator to SpatialJoinOperators.SpatialIndexBuilderOperator creates a spatial index
Supplier
and provides it to this factory by callinglendPagesSpatialIndex(Supplier)
.SpatialJoinOperators call
createPagesSpatialIndex()
to get a Future that will provide an instance of the spatial index when done. TheSupplier
is used to create separate instances of an index for each SpatialJoinOperator. All these instances share the index of geometries on the build side, but have their own instances of an optional extra potentially stateful filter function.SpatialIndexBuilderOperator is responsible for keeping track of how much memory is used by the index shared among SpatialJoinOperators. To do so SpatialIndexBuilderOperator has to stay active until all the SpatialJoinOperators have finished.
lendPagesSpatialIndex(Supplier)
returns a Future that completes once all the SpatialJoinOperators completed. SpatialIndexBuilderOperator uses that Future to decide on its own completion.
-
-
Constructor Summary
Constructors Constructor Description PagesSpatialIndexFactory(List<Type> types, List<Type> outputTypes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.common.util.concurrent.ListenableFuture<PagesSpatialIndex>
createPagesSpatialIndex()
Called bySpatialJoinOperator
.void
destroy()
List<Type>
getOutputTypes()
List<Type>
getTypes()
com.google.common.util.concurrent.ListenableFuture<?>
lendPagesSpatialIndex(Supplier<PagesSpatialIndex> pagesSpatialIndex)
Called bySpatialIndexBuilderOperator
to provide aSupplier
of spatial indexes forSpatialJoinOperator
s to use.
-
-
-
Method Detail
-
destroy
public void destroy()
-
createPagesSpatialIndex
public com.google.common.util.concurrent.ListenableFuture<PagesSpatialIndex> createPagesSpatialIndex()
Called bySpatialJoinOperator
.
-
lendPagesSpatialIndex
public com.google.common.util.concurrent.ListenableFuture<?> lendPagesSpatialIndex(Supplier<PagesSpatialIndex> pagesSpatialIndex)
Called bySpatialIndexBuilderOperator
to provide aSupplier
of spatial indexes forSpatialJoinOperator
s to use.Returns a Future that completes once all the
SpatialJoinOperator
s have completed.
-
-