Class LocalSearchBackend
- java.lang.Object
-
- org.eclipse.viatra.query.runtime.localsearch.matcher.integration.LocalSearchBackend
-
- All Implemented Interfaces:
IQueryBackend
public abstract class LocalSearchBackend extends java.lang.Object implements IQueryBackend
- No Extend:
- This class is not intended to be subclassed by clients.
-
-
Constructor Summary
Constructors Constructor Description LocalSearchBackend(IQueryBackendContext context)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddAdapter(ILocalSearchAdapter adapter)voiddispose()Disposes the query backend.voidflushUpdates()Propagates all pending updates in this query backend.java.util.List<ILocalSearchAdapter>getAdapters()Return a copy of the current adaptersIQueryBackendContextgetBackendContext()ICachegetCache()Returns the internal cache of the backendIQueryBackendHintProvidergetHintProvider()QueryAnalyzergetQueryAnalyzer()IQueryResultProvidergetResultProvider(PQuery query)Returns a result provider for a given query.IQueryResultProvidergetResultProvider(PQuery query, QueryEvaluationHint hints)Returns a result provider for a given query.ResultProviderRequestorgetResultProviderRequestor(PQuery query, QueryEvaluationHint userHints)Returns a requestor that this backend uses while processing pattern calls from this query.IQueryRuntimeContextgetRuntimeContext()IPlanDescriptorgetSearchPlan(PQuery query, java.util.Set<PParameter> adornment)Returns a search plan for a given query and adornment if such plan is already calculated.protected abstract AbstractLocalSearchResultProviderinitializeResultProvider(PQuery query, QueryEvaluationHint hints)booleanisCaching()AbstractLocalSearchResultProviderpeekExistingResultProvider(PQuery query)Returns an existing result provider for a given query, if it was previously constructed, returns null otherwise.voidrecomputePlans()Updates the previously stored search plans for one or more given queries, computing a new set of plans if necessary The new plans created are the same that would be created by executing prepare on the given query definitions.voidrecomputePlans(java.util.Collection<PQuery> queries)Updates the previously stored search plans for one or more given queries, computing a new set of plans if necessary The new plans created are the same that would be created by executing prepare on the given query definitions.voidrecomputePlans(PQuery... queries)Updates the previously stored search plans for one or more given queries, computing a new set of plans if necessary.voidremoveAdapter(ILocalSearchAdapter adapter)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.viatra.query.runtime.matchers.backend.IQueryBackend
getFactory
-
-
-
-
Constructor Detail
-
LocalSearchBackend
public LocalSearchBackend(IQueryBackendContext context)
- Since:
- 1.5
-
-
Method Detail
-
flushUpdates
public void flushUpdates()
Description copied from interface:IQueryBackendPropagates all pending updates in this query backend. The implementation of this method is optional, and it can be ignored entirely if the backend does not delay updates.- Specified by:
flushUpdatesin interfaceIQueryBackend
-
getResultProvider
public IQueryResultProvider getResultProvider(PQuery query)
Description copied from interface:IQueryBackendReturns a result provider for a given query. Repeated calls may return the same instance.- Specified by:
getResultProviderin interfaceIQueryBackend
-
getResultProvider
public IQueryResultProvider getResultProvider(PQuery query, QueryEvaluationHint hints)
Description copied from interface:IQueryBackendReturns a result provider for a given query. Repeated calls may return the same instance.- Specified by:
getResultProviderin interfaceIQueryBackend- Since:
- 1.4
-
getResultProviderRequestor
public ResultProviderRequestor getResultProviderRequestor(PQuery query, QueryEvaluationHint userHints)
Returns a requestor that this backend uses while processing pattern calls from this query.- Since:
- 2.1
- No Reference:
- This method is not intended to be referenced by clients.
-
initializeResultProvider
protected abstract AbstractLocalSearchResultProvider initializeResultProvider(PQuery query, QueryEvaluationHint hints)
- Throws:
ViatraQueryRuntimeException- Since:
- 1.7
-
dispose
public void dispose()
Description copied from interface:IQueryBackendDisposes the query backend.- Specified by:
disposein interfaceIQueryBackend
-
isCaching
public boolean isCaching()
- Specified by:
isCachingin interfaceIQueryBackend- Returns:
- true iff this backend is incremental, i.e. it caches the results of queries for quick retrieval, and can provide update notifications on result set changes.
-
peekExistingResultProvider
public AbstractLocalSearchResultProvider peekExistingResultProvider(PQuery query)
Description copied from interface:IQueryBackendReturns an existing result provider for a given query, if it was previously constructed, returns null otherwise. Will not construct and initialize new result providers.- Specified by:
peekExistingResultProviderin interfaceIQueryBackend- Since:
- 2.0
-
getRuntimeContext
public IQueryRuntimeContext getRuntimeContext()
- Since:
- 1.4
-
getQueryAnalyzer
public QueryAnalyzer getQueryAnalyzer()
- Since:
- 1.5
-
getHintProvider
public IQueryBackendHintProvider getHintProvider()
- Since:
- 1.4
-
addAdapter
public void addAdapter(ILocalSearchAdapter adapter)
- Since:
- 1.5
-
removeAdapter
public void removeAdapter(ILocalSearchAdapter adapter)
- Since:
- 1.5
-
getAdapters
public java.util.List<ILocalSearchAdapter> getAdapters()
Return a copy of the current adapters- Since:
- 1.7
-
getBackendContext
public IQueryBackendContext getBackendContext()
- Since:
- 1.5
-
getCache
public ICache getCache()
Returns the internal cache of the backend- Since:
- 1.7
- No Reference:
- This method is not intended to be referenced by clients.
-
recomputePlans
public void recomputePlans(PQuery... queries)
Updates the previously stored search plans for one or more given queries, computing a new set of plans if necessary. The new plans created are the same that would be created by executing prepare on the given query definitions.- Since:
- 2.0
-
recomputePlans
public void recomputePlans(java.util.Collection<PQuery> queries)
Updates the previously stored search plans for one or more given queries, computing a new set of plans if necessary The new plans created are the same that would be created by executing prepare on the given query definitions.- Since:
- 2.0
-
recomputePlans
public void recomputePlans()
Updates the previously stored search plans for one or more given queries, computing a new set of plans if necessary The new plans created are the same that would be created by executing prepare on the given query definitions.- Since:
- 2.0
-
getSearchPlan
public IPlanDescriptor getSearchPlan(PQuery query, java.util.Set<PParameter> adornment)
Returns a search plan for a given query and adornment if such plan is already calculated.- Returns:
- a previously calculated search plan for the given query and adornment, or null if no such plan exists
- Since:
- 2.0
-
-