Class AbstractLocalSearchResultProvider
java.lang.Object
tools.refinery.interpreter.localsearch.matcher.integration.AbstractLocalSearchResultProvider
- All Implemented Interfaces:
IQueryResultProvider
- Direct Known Subclasses:
GenericLocalSearchResultProvider
public abstract class AbstractLocalSearchResultProvider
extends Object
implements IQueryResultProvider
- Since:
- 1.7
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final LocalSearchBackendprotected final IQueryBackendContextprotected final Map<PQuery, LocalSearchHints> protected final IPlanProviderprotected final PQueryprotected ResultProviderRequestorprotected final IQueryRuntimeContextprotected final ISearchContextprotected final QueryEvaluationHint -
Constructor Summary
ConstructorsConstructorDescriptionAbstractLocalSearchResultProvider(LocalSearchBackend backend, IQueryBackendContext context, PQuery query, IPlanProvider planProvider, QueryEvaluationHint userHints) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddUpdateListener(IUpdateable listener, Object listenerTag, boolean fireNow) intcountMatches(Object[] parameters) intcountMatches(TupleMask parameterSeedMask, ITuple parameters) estimateAverageBucketSize(TupleMask groupMask, Accuracy requiredAccuracy) estimateCardinality(TupleMask groupMask, Accuracy requiredAccuracy) doubleestimateCost(TupleMask inputBindingMask) voidForgets all stored plans in this result provider.getAllMatches(Object[] parameters) getAllMatches(TupleMask parameterSeedMask, ITuple parameters) getOneArbitraryMatch(Object[] parameters) getOneArbitraryMatch(TupleMask parameterSeedMask, ITuple parameters) protected abstract IOperationCompilergetOperationCompiler(IQueryBackendContext backendContext, LocalSearchHints configuration) getSearchPlan(Set<PParameter> adornment) Returns a search plan for a given adornment if existsbooleanbooleanprotected voidThis method is called before planning start to allow indexing.protected voidindexReferredTypesOfQuery(PQuery query, IndexingService requiredIndexingServices) Collects and indexes all types _directly_ referred by the PQueryquery.newLocalSearchMatcher(Object[] parameters) newLocalSearchMatcher(ITuple parameters) voidprepare()Prepare this result provider.protected voidprotected voidvoidremoveUpdateListener(Object listenerTag)
-
Field Details
-
backend
-
backendContext
-
runtimeContext
-
query
-
userHints
-
hintCache
-
planProvider
-
searchContext
-
resultProviderRequestor
- Since:
- 2.1
-
-
Constructor Details
-
AbstractLocalSearchResultProvider
public AbstractLocalSearchResultProvider(LocalSearchBackend backend, IQueryBackendContext context, PQuery query, IPlanProvider planProvider, QueryEvaluationHint userHints) - Since:
- 1.5
-
-
Method Details
-
getOperationCompiler
protected abstract IOperationCompiler getOperationCompiler(IQueryBackendContext backendContext, LocalSearchHints configuration) -
prepare
public void prepare()Prepare this result provider. This phase is separated from the constructor to allow the backend to cache its instance before requesting preparation for its dependencies.- Since:
- 1.5
-
preparePlansForExpectedAdornments
protected void preparePlansForExpectedAdornments() -
prepareDirectDependencies
protected void prepareDirectDependencies() -
indexInitializationBeforePlanning
protected void indexInitializationBeforePlanning()This method is called before planning start to allow indexing. It is important to note that this method is called inside a coalesceTraversals block, meaning (1) it is safe to add multiple registration requests as necessary, but (2) no value or statistics is available from the index.- Throws:
InterpreterRuntimeException
-
indexReferredTypesOfQuery
Collects and indexes all types _directly_ referred by the PQueryquery. Types indirect- Parameters:
requiredIndexingServices-
-
newLocalSearchMatcher
- Throws:
InterpreterRuntimeException
-
newLocalSearchMatcher
- Throws:
InterpreterRuntimeException
-
hasMatch
- Specified by:
hasMatchin interfaceIQueryResultProvider
-
hasMatch
- Specified by:
hasMatchin interfaceIQueryResultProvider
-
getOneArbitraryMatch
- Specified by:
getOneArbitraryMatchin interfaceIQueryResultProvider
-
getOneArbitraryMatch
- Specified by:
getOneArbitraryMatchin interfaceIQueryResultProvider
-
countMatches
- Specified by:
countMatchesin interfaceIQueryResultProvider
-
countMatches
- Specified by:
countMatchesin interfaceIQueryResultProvider
-
estimateCardinality
- Specified by:
estimateCardinalityin interfaceIQueryResultProvider
-
estimateAverageBucketSize
- Specified by:
estimateAverageBucketSizein interfaceIQueryResultProvider
-
estimateCost
- Since:
- 2.1
-
getAllMatches
- Specified by:
getAllMatchesin interfaceIQueryResultProvider
-
getAllMatches
- Specified by:
getAllMatchesin interfaceIQueryResultProvider
-
getQueryBackend
- Specified by:
getQueryBackendin interfaceIQueryResultProvider
-
addUpdateListener
- Specified by:
addUpdateListenerin interfaceIQueryResultProvider
-
removeUpdateListener
- Specified by:
removeUpdateListenerin interfaceIQueryResultProvider
-
getCapabilites
- Since:
- 1.4
-
forgetAllPlans
public void forgetAllPlans()Forgets all stored plans in this result provider. If no plans are stored, nothing happens.- Since:
- 2.0
-
getSearchPlan
Returns a search plan for a given adornment if exists- Returns:
- a search plan for the pattern with the given adornment, or null if none exists
- Since:
- 2.0
-