Class GeophileSpatialObjectQueryPlan
java.lang.Object
com.apple.foundationdb.record.spatial.geophile.GeophileSpatialObjectQueryPlan
- All Implemented Interfaces:
PlanHashable,PlanSerializable,Correlated<RelationalExpression>,com.apple.foundationdb.record.query.plan.cascades.explain.PlannerGraphRewritable,RelationalExpression,Narrowable<RelationalExpression>,com.apple.foundationdb.record.query.plan.cascades.typing.Typed,QueryPlan<FDBQueriedRecord<Message>>,RecordQueryPlan,RecordQueryPlanWithIndex,RecordQueryPlanWithMatchCandidate,RecordQueryPlanWithNoChildren
- Direct Known Subclasses:
GeophilePointWithinDistanceQueryPlan
@API(EXPERIMENTAL)
public abstract class GeophileSpatialObjectQueryPlan
extends Object
implements RecordQueryPlanWithNoChildren, RecordQueryPlanWithIndex
Base class for query plans that execute a spatial join between a single spatial object and a spatial index.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.apple.foundationdb.record.query.plan.cascades.Correlated
Correlated.BoundEquivalence<S extends Correlated<S>>Nested classes/interfaces inherited from interface com.apple.foundationdb.record.PlanHashable
PlanHashable.PlanHashKind, PlanHashable.PlanHashModeNested classes/interfaces inherited from interface com.apple.foundationdb.record.query.plan.cascades.expressions.RelationalExpression
RelationalExpression.CombineFunction<R extends Object,S extends Object>, RelationalExpression.CombinePredicate -
Field Summary
Fields inherited from interface com.apple.foundationdb.record.PlanHashable
CURRENT_FOR_CONTINUATION, CURRENT_LEGACYFields inherited from interface com.apple.foundationdb.record.query.plan.plans.QueryPlan
UNKNOWN_MAX_CARDINALITY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedGeophileSpatialObjectQueryPlan(String indexName, ScanComparisons prefixComparisons) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanequalsWithoutChildren(RelationalExpression otherExpression, AliasMap equivalencesMap) <M extends Message>
RecordCursor<IndexEntry>executeEntries(FDBRecordStoreBase<M> store, EvaluationContext context, byte[] continuation, ExecuteProperties executeProperties) intprotected com.geophile.z.SpatialJoin.Filter<com.geophile.z.index.RecordWithSpatialObject,com.apple.foundationdb.record.spatial.geophile.GeophileRecordImpl> getFilter(EvaluationContext context) Get a optional filter to eliminate false positives from the spatial join.Optional<? extends MatchCandidate>List<? extends Quantifier>protected BiFunction<IndexEntry,Tuple, com.apple.foundationdb.record.spatial.geophile.GeophileRecordImpl> Get the function to use for mappingIndexEntrytoGeophileRecordImpl.protected abstract com.geophile.z.SpatialObjectgetSpatialObject(EvaluationContext context) Get the spatial object with which to join spatial index entries.booleaninthashCode()intbooleanhasIndexScan(String indexName) booleanbooleanbooleanvoidlogPlanStructure(StoreTimer timer) translateCorrelations(com.apple.foundationdb.record.query.plan.cascades.values.translation.TranslationMap translationMap, boolean shouldSimplifyValues, List<? extends Quantifier> translatedQuantifiers) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.apple.foundationdb.record.query.plan.cascades.Correlated
isCorrelatedToMethods inherited from interface com.apple.foundationdb.record.query.plan.cascades.Narrowable
narrowMaybeMethods inherited from interface com.apple.foundationdb.record.PlanHashable
planHash, planHash, planHashMethods inherited from interface com.apple.foundationdb.record.query.plan.plans.QueryPlan
collectDescendantPlans, execute, execute, isStrictlySorted, maxCardinalityMethods inherited from interface com.apple.foundationdb.record.query.plan.plans.RecordQueryPlan
accept, canBeMinimized, execute, execute, execute, execute, getAvailableFields, getQueryPlanChildren, minimize, minimize, structuralEquals, structuralEquals, structuralHashCode, toProto, toRecordQueryPlanProtoMethods inherited from interface com.apple.foundationdb.record.query.plan.plans.RecordQueryPlanWithIndex
allowedForCoveringIndexPlan, createIndexPlannerGraph, executePlan, fetchIndexRecords, getFetchIndexRecords, rewritePlannerGraph, strictlySortedMethods inherited from interface com.apple.foundationdb.record.query.plan.plans.RecordQueryPlanWithMatchCandidate
getMatchCandidateMethods inherited from interface com.apple.foundationdb.record.query.plan.plans.RecordQueryPlanWithNoChildren
getChildrenMethods inherited from interface com.apple.foundationdb.record.query.plan.cascades.expressions.RelationalExpression
acceptVisitor, adjustMatch, bindIdentities, canCorrelate, compensate, enumerateUnboundCorrelatedTo, exactlySubsumedBy, findMatches, getCorrelationOrder, getDynamicTypes, getMatchedQuantifiers, getResultType, getResultValue, hasIncompatibleBoundQuantifiers, hasUnboundQuantifiers, isCompatiblyAndCompletelyBound, match, match, rebase, semanticEquals, semanticEquals, semanticEqualsForResults, semanticHashCode, show, showExploratory, subsumedBy, withQuantifiersMethods inherited from interface com.apple.foundationdb.record.query.plan.cascades.typing.Typed
describe
-
Constructor Details
-
GeophileSpatialObjectQueryPlan
protected GeophileSpatialObjectQueryPlan(@Nonnull String indexName, @Nonnull ScanComparisons prefixComparisons)
-
-
Method Details
-
getSpatialObject
@Nullable protected abstract com.geophile.z.SpatialObject getSpatialObject(@Nonnull EvaluationContext context) Get the spatial object with which to join spatial index entries.- Parameters:
context- query context containing parameter bindings- Returns:
- a spatial object to use in spatial join or
nullif some bound parameter is null.
-
getFilter
@Nullable protected com.geophile.z.SpatialJoin.Filter<com.geophile.z.index.RecordWithSpatialObject,com.apple.foundationdb.record.spatial.geophile.GeophileRecordImpl> getFilter(@Nonnull EvaluationContext context) Get a optional filter to eliminate false positives from the spatial join. The filter will have access only to theSpatialObjectfor the join and theGeophileRecordImplfor the index entry. If the index is covering,GeophileRecordImpl.spatialObject()will then be available. If there is no filter, or the filter is not entirely effective, someQueryComponentform of the original predicate will almost certainly be needed downstream of theSpatialObjectQueryPlan.- Parameters:
context- query context containing parameter bindings- Returns:
- a spatial join filter or
nullif none is possible
-
getRecordFunction
protected BiFunction<IndexEntry,Tuple, getRecordFunction()com.apple.foundationdb.record.spatial.geophile.GeophileRecordImpl> Get the function to use for mappingIndexEntrytoGeophileRecordImpl. If the index is covering, the indexedSpatialObjectmay be recoverable from the value part of the index entry.- Returns:
- a function that creates new
GeophileRecordImplinstances
-
getPrefixComparisons
-
getIndexName
- Specified by:
getIndexNamein interfaceRecordQueryPlanWithIndex
-
getScanType
- Specified by:
getScanTypein interfaceRecordQueryPlanWithIndex
-
getMatchCandidateMaybe
- Specified by:
getMatchCandidateMaybein interfaceRecordQueryPlanWithMatchCandidate
-
executeEntries
@Nonnull public <M extends Message> RecordCursor<IndexEntry> executeEntries(@Nonnull FDBRecordStoreBase<M> store, @Nonnull EvaluationContext context, @Nullable byte[] continuation, @Nonnull ExecuteProperties executeProperties) - Specified by:
executeEntriesin interfaceRecordQueryPlanWithIndex
-
isReverse
public boolean isReverse()- Specified by:
isReversein interfaceQueryPlan<FDBQueriedRecord<Message>>
-
hasRecordScan
public boolean hasRecordScan()- Specified by:
hasRecordScanin interfaceQueryPlan<FDBQueriedRecord<Message>>
-
hasFullRecordScan
public boolean hasFullRecordScan()- Specified by:
hasFullRecordScanin interfaceQueryPlan<FDBQueriedRecord<Message>>
-
hasIndexScan
- Specified by:
hasIndexScanin interfaceQueryPlan<FDBQueriedRecord<Message>>
-
getUsedIndexes
- Specified by:
getUsedIndexesin interfaceQueryPlan<FDBQueriedRecord<Message>>
-
hasLoadBykeys
public boolean hasLoadBykeys()- Specified by:
hasLoadBykeysin interfaceQueryPlan<FDBQueriedRecord<Message>>
-
logPlanStructure
- Specified by:
logPlanStructurein interfaceQueryPlan<FDBQueriedRecord<Message>>
-
getComplexity
public int getComplexity()- Specified by:
getComplexityin interfaceQueryPlan<FDBQueriedRecord<Message>>
-
getQuantifiers
- Specified by:
getQuantifiersin interfaceRecordQueryPlanWithNoChildren- Specified by:
getQuantifiersin interfaceRelationalExpression
-
translateCorrelations
@Nonnull public GeophileSpatialObjectQueryPlan translateCorrelations(@Nonnull com.apple.foundationdb.record.query.plan.cascades.values.translation.TranslationMap translationMap, boolean shouldSimplifyValues, @Nonnull List<? extends Quantifier> translatedQuantifiers) - Specified by:
translateCorrelationsin interfaceRecordQueryPlanWithIndex- Specified by:
translateCorrelationsin interfaceRelationalExpression
-
equalsWithoutChildren
public boolean equalsWithoutChildren(@Nonnull RelationalExpression otherExpression, @Nonnull AliasMap equivalencesMap) - Specified by:
equalsWithoutChildrenin interfaceRelationalExpression
-
equals
-
hashCode
public int hashCode() -
hashCodeWithoutChildren
public int hashCodeWithoutChildren()- Specified by:
hashCodeWithoutChildrenin interfaceRelationalExpression
-