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 LocalSearchBackend
protected final IQueryBackendContext
protected final Map
<PQuery, LocalSearchHints> protected final IPlanProvider
protected final PQuery
protected ResultProviderRequestor
protected final IQueryRuntimeContext
protected final ISearchContext
protected final QueryEvaluationHint
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractLocalSearchResultProvider
(LocalSearchBackend backend, IQueryBackendContext context, PQuery query, IPlanProvider planProvider, QueryEvaluationHint userHints) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addUpdateListener
(IUpdateable listener, Object listenerTag, boolean fireNow) int
countMatches
(Object[] parameters) int
countMatches
(TupleMask parameterSeedMask, ITuple parameters) estimateAverageBucketSize
(TupleMask groupMask, Accuracy requiredAccuracy) estimateCardinality
(TupleMask groupMask, Accuracy requiredAccuracy) double
estimateCost
(TupleMask inputBindingMask) void
Forgets 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 IOperationCompiler
getOperationCompiler
(IQueryBackendContext backendContext, LocalSearchHints configuration) getSearchPlan
(Set<PParameter> adornment) Returns a search plan for a given adornment if existsboolean
boolean
protected void
This method is called before planning start to allow indexing.protected void
indexReferredTypesOfQuery
(PQuery query, IndexingService requiredIndexingServices) Collects and indexes all types _directly_ referred by the PQueryquery
.newLocalSearchMatcher
(Object[] parameters) newLocalSearchMatcher
(ITuple parameters) void
prepare()
Prepare this result provider.protected void
protected void
void
removeUpdateListener
(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:
hasMatch
in interfaceIQueryResultProvider
-
hasMatch
- Specified by:
hasMatch
in interfaceIQueryResultProvider
-
getOneArbitraryMatch
- Specified by:
getOneArbitraryMatch
in interfaceIQueryResultProvider
-
getOneArbitraryMatch
- Specified by:
getOneArbitraryMatch
in interfaceIQueryResultProvider
-
countMatches
- Specified by:
countMatches
in interfaceIQueryResultProvider
-
countMatches
- Specified by:
countMatches
in interfaceIQueryResultProvider
-
estimateCardinality
- Specified by:
estimateCardinality
in interfaceIQueryResultProvider
-
estimateAverageBucketSize
- Specified by:
estimateAverageBucketSize
in interfaceIQueryResultProvider
-
estimateCost
- Since:
- 2.1
-
getAllMatches
- Specified by:
getAllMatches
in interfaceIQueryResultProvider
-
getAllMatches
- Specified by:
getAllMatches
in interfaceIQueryResultProvider
-
getQueryBackend
- Specified by:
getQueryBackend
in interfaceIQueryResultProvider
-
addUpdateListener
- Specified by:
addUpdateListener
in interfaceIQueryResultProvider
-
removeUpdateListener
- Specified by:
removeUpdateListener
in 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
-